document get first element of class code example
Example: js get first element by class
var elements = document.getElementsByClassName('className');
var requiredElement = elements[0];
var elements = document.getElementsByClassName('className');
var requiredElement = elements[0];