dom-manipulation Flashcards
1
Q
What is the className property of element objects?
A
string variable representing the class name
2
Q
How do you update the CSS class attribute of an element using JavaScript?
A
.className = ‘new-class-name’
3
Q
What is the textContent property of element objects?
A
represents the text content of the node in question
4
Q
How do you update the text within an element using JavaScript?
A
.textContent = ‘new text content’
5
Q
Is the event parameter of an event listener callback always useful?
A
not always, but its good practice
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
it would be more complicated if we didn’t keep track of the click number