dom-manipulation Flashcards
What is the className property of element objects?
Property that gets and sets the className of an element.
How do you update the CSS class attribute of an element using JavaScript?
Using the className property.
What is the textContent property of element objects?
Property that gets and sets the text content of an element.
How do you update the text within an element using JavaScript?
Using the textContent property.
Is the event parameter of an event listener callback always useful?
Generally, yes.
Would this assignment be simpler or more complicated if we didn’t use a variable to keep track of the number of clicks?
More complicated.
Why is storing information about a program in variables better than only storing it in the DOM?
Because storing DOM locations in a variable prevents the browser from looking for the information.