DOM Manipulation

(Assignments here & here)


Problem Set

Blog Questions

  • querySelector( ) allows the selection of an element by any CSS selector, while querySelectorAll( ) allows the selection of a set of elements by any CSS selector.
  • Four examples to select this element are:
<p id="one" class=".main">This awesome paragraph!</p>

var select1 = document.querySelector("#one")
var select2 = document.querySelector(".main")
var select3 = document.querySelector("p")
var select4 = document.querySelectorAll("p")[0]

Leave a Reply

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