dom querying Flashcards
Why do we log things to the console?
to debug
What is a “model”?
a dom tree - what the web page loads
Which “document” is being referred to in the phrase Document Object Model?
html document
What is the word “object” referring to in the phrase Document Object Model?
each node
What is a DOM Tree?
a tree structure of the html
Give two examples of document methods that retrieve a single element from the DOM.
getelementbyID , queryselector
Give one example of a document method that retrieves multiple elements from the DOM at once
getElementByClassName
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?
gives the HTML time to load before any of the JavaScript loads
What does document.querySelector() take as its argument and what does it return?
takes element selected returns the first Element within the document that matches the specified selector,
What does document.querySelectorAll() take as its argument and what does it return?
takes in all the elements selected and returns nodelist