DOM Flashcards
Why do we log things to the console?
To verify the value, debug, and visualize input and outputs.
What is a “model”?
general representation, copy
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?
JavaScript objects: a data type that can hold values
What is a DOM Tree?
series of objects that make up the HTML document
Give two examples of document methods that retrieve a single element from the DOM.
.querySelector(), getElementbyId()
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?
it’s faster and for organizational purposes
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?
so that it loads till the very end
What does document.querySelector() take as its argument and what does it return?
CSS selector and return the first element that matches the pattern
What does document.querySelectorAll() take as its argument and what does it return?
returns a NodeList
Why do we log things to the console?
debugging
What is the purpose of events and event handling?
respond to user events
Are all possible parameters required to use a JavaScript method or function?
No,