JavaScript Get Element według klasy
var elementsArray = document.getElementsByClassName("someclassname");
Grepper
var elementsArray = document.getElementsByClassName("someclassname");
var selector = document.getElementsByClassName('class-name');
let elementsArray = document.getElementsByClassName("className");
// OR
let element = document.querySelector(".className");
var elements = document.querySelector(".class");
var elements = document.getElementsByClassName(names); // or:
var elements = rootElement.getElementsByClassName(names);
var x = document.getElementsByClassName("example");
var i;
for (i = 0; i < x.length; i++) {
x[i].style.backgroundColor = "red";
}