how to loop through all elements in the document and select based on class name code example
Example: javascript loop through class elements
var els = document.getElementsByClassName("myClass");
for(var i = 0; i < els.length; i++)
{
console.log(els[i]);
}