js get first element by class

93

js get first element by class -

var elements = document.getElementsByClassName('className');
var requiredElement = elements[0];

Comments

Submit
0 Comments