get element by class
snippet in javascript

javascript get element by class

user4238

var elementsArray = document.getElementsByClassName("someclassname");

get element by class

user4353

var elements = document.getElementsByClassName(names); // or:
var elements = rootElement.getElementsByClassName(names);

html get elements by class

user8325


 var x = document.getElementsByClassName("example");

 

javascript get element by id

user2718

var myElement=document.getElementById("someElementID");

get element by class

user2527


 var x =
 document.getElementsByClassName("example");