Dom -querying Flashcards
What is a “model”?
model of the page
Which “document” is being referred to in the phrase Document Object Model?
tree structures
What is the word “object” referring to in the phrase Document Object Model?
all the elements + attribute
What is a DOM Tree?
model of that page
Give two examples of document methods that retrieve a single element from the DOM.
- getElementBy Id()
2. querySelector();
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?
don’t have to keep checking
What console method allows you to inspect the properties of a DOM element object?
console.dir
Why would a tag need to be placed at the bottom of the HTML content instead of at the top?
to access an the object of the DOM
What does document.querySelector() take as its argument and what does it return?
selectors –> DOMstring
Return –> first matching
What does document.querySelectorAll() take as its argument and what does it return?
selectors –> DOM string
return value –> nodelist