DOM manipulation

dom-intro

dom-intro.js

selector-exercise

selector-exercise.js

querySelector() returns the first instance of the specified selector while querySelectorAll() selects every instance of the specified selector. Tags, classes, and Ids can be selected.

<p id=”one” class=”.main”>This awesome paragraph!</p

document.querySelector("#one");
document.querySelector("..main");
document.querySelector("p");
document.querySelectorAll("p");

 

Leave a comment

Your email address will not be published. Required fields are marked *