javascript get element by class name loop code example
Example 1: javascript loop through class elements
var els = document.getElementsByClassName("myClass");
for(var i = 0; i < els.length; i++)
{
console.log(els[i]);
}
Example 2: how to get element by class name javascript
document.getElementsByClassName("legend").style.display="none";