Which DOM method follows CSS syntax? code example
Example 1: queryselector function in javascript
// for example
//for class
document.querySelector(".ClassName")
// for id
document.querySelector("#ID")
// etc.
Example 2: dom queryselector
// TO select all the h1 from Html
document.querySelectorAll("h1")
//To select h1 from a particular class or id
document.querySelector(".className/#id h1")
Example 3: Which DOM method follows CSS syntax?
document.querySelector(".example");
document.querySelector("#example");