dom-querying Flashcards
Why do we log things to the console?
check functionality and check data
What is a “model”?
a recreation of something to be used as an example
Which “document” is being referred to in the phrase Document Object Model?
the HTML document
What is the word “object” referring to in the phrase Document Object Model?
the elements
What is a DOM Tree?
the breakdown of the document
Give one example of a document method that retrieves multiple elements from the DOM at once.
querySelectorAll
Why might you want to assign the return value of a DOM query to a variable?
to store the location of the element
What console method allows you to inspect the properties of a DOM element object?
console.dir
What does document.querySelector() take as its argument and what does it return?
CSS selector and returns only the first of matching elements
Why would a tag need to be placed at the bottom of the HTML content instead of at the top?
so that JS runs after the HTML is loaded
Give two examples of document methods that retrieve a single element from the DOM.
getElementById, querySelector
What does document.querySelectorAll() take as its argument and what does it return?
CSS selector and returns all that match