Dom -querying Flashcards

1
Q

What is a “model”?

A

model of the page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which “document” is being referred to in the phrase Document Object Model?

A

tree structures

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the word “object” referring to in the phrase Document Object Model?

A

all the elements + attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a DOM Tree?

A

model of that page

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Give two examples of document methods that retrieve a single element from the DOM.

A
  1. getElementBy Id()

2. querySelector();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Give one example of a document method that retrieves multiple elements from the DOM at once.

A

querySelectorAll()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Why might you want to assign the return value of a DOM query to a variable?

A

don’t have to keep checking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What console method allows you to inspect the properties of a DOM element object?

A

console.dir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Why would a tag need to be placed at the bottom of the HTML content instead of at the top?

A

to access an the object of the DOM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does document.querySelector() take as its argument and what does it return?

A

selectors –> DOMstring

Return –> first matching

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does document.querySelectorAll() take as its argument and what does it return?

A

selectors –> DOM string

return value –> nodelist

How well did you know this?
1
Not at all
2
3
4
5
Perfectly