DOM Manipulation Flashcards

1
Q

What is the className property of element objects?

A

Gets and sets the value of the class attribute of the specified element

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

How do you update the CSS class attribute of an element using JavaScript?

A

element.className property = updated value

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

What is the textContent property of element objects?

A

Sets or returns the text content of the specified node, and all its descendants

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

How do you update the text within an element using JavaScript?

A

element.textContent property = new value

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

Is the event parameter of an event listener callback always useful?

A

No

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

Would this assignment be simpler or more complicated if we didn’t use a variable to keep track of the number of clicks?

A

More complicated

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

Why is storing information about a program in variables better than only storing it in the DOM?

A

Do not have to do DOM lookups.
DO not have to worry about unexpected behavior of the browser

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