getelementbyclass

JavaScript
var selector = document.getElementsByClassName('class-name'); var x =
 document.getElementsByClassName("example");

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

Also in JavaScript: