Quantcast
Viewing latest article 10
Browse Latest Browse All 10

JavaScript – Get DOM element by class name

Select a DOM HTML element by class. (is a fix for IE…and older browser)
Use it in this way:
var element = Core.getElementByClass("myClass");

element.length; //number of matched elements
element[0]; //first element found
element[1]; //second element found
element[3].tagName
console.log(element[0]);


Viewing latest article 10
Browse Latest Browse All 10

Trending Articles