js select element by css selector

JavaScript
// First Element:
document.querySelector('.class')

// Multiple Elements:
document.querySelectorAll('.class')document.querySelector(".example");
Source

Also in JavaScript: