js get element by css selector code example
Example 1: js select element by css selector
document.querySelector('.class')
document.querySelectorAll('.class')
Example 2: do some css using js on selector
let myElement = document.querySelector("#superman");
myElement.style.backgroundColor = "#D93600";
Example 3: queryselector for jquery
var x = $(".yourclass")[0];
console.log('jq' + x);
var y = document.querySelector(".yourclass");
console.log('js' + y);
Example 4: queryselector function in javascript
document.querySelector(".ClassName")
document.querySelector("#ID")