get element by class

JavaScript
var elementsArray = document.getElementsByClassName("someclassname");var elements = document.getElementsByClassName(names); // or:
var elements = rootElement.getElementsByClassName(names);var elements = document.querySelector(".class");document.getElementsByClassName("legend").style.display="none";var myElement=document.getElementById("someElementID");const whiteBoxes = document.getElementsByClassName("box-white")
Source

Also in JavaScript: