DOM Flashcards
Does the document.createElement() method insert a new element into the page?
No
How do you add an element as a child to another element?
.appendChild()
.append()
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?
JavaScript object
What is a DOM Tree?
A tree representing each element within the DOM, and its child elements
Give two examples of document methods that retrieve a single element from the DOM.
document. getElementById()
document. querySelector()
Give one example of a document method that retrieves multiple elements from the DOM at once.
document.querySelectorAll()
Why might you want to assign the return value of a DOM query to a variable?
So you can access it again more easily
What console method allows you to inspect the properties of a DOM element object?
consle.dir()