DOM Flashcards
Why do we log things to the console?
verify values to help debug
Which “document” is being referred to in the phrase Document Object Model?
the entire page (html)
Which “document” is being referred to in the phrase Document Object Model?
the entire page (html document)
What is a DOM Tree?
a model of the web page (html doc) as a javascript object
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?
in case you need to work with the element more han once
What console method allows you to inspect the properties of a DOM element object?
console.dir()
Why would a script tag need to be placed at the bottom of the HTML content instead of at the top?
the rest of the page must be loaded to create an accurate DOM tree
Why would a script tag need to be placed at the bottom of the HTML content instead of at the top?
the rest of the page must be loaded/created to create an accurate DOM tree
What does document.querySelectorAll() take as its argument and what does it return?
CSS selector; returns all matching element
What does document.querySelectorAll() take as its argument and what does it return?
CSS selector; returns all matching element in the form of a node list
What is the word “object” referring to in the phrase Document Object Model?
a data type in javascript which can hold multiple items
Why do we log things to the console?
check things
What is the purpose of events and event handling?
respond to occurrences
Are all possible parameters required to use a JavaScript method or function?
no