js get first element by class

96

js get first element by class -

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

Comments

Submit
0 Comments