how to get first element by class code example
Example 1: select the first elemnt have class in jquery
$( ".box" ).first().css( "font-style", "bold" );
Example 2: js get first element by class
var elements = document.getElementsByClassName('className');
var requiredElement = elements[0];