dom-manipulation Flashcards
What is the className property of element objects?
selects and changes the value of the class attribute of specified elements
How do you update the CSS class attribute of an element using JavaScript?
using className property and selecting the CSS property
What is the textContent property of element objects?
it selects and changes the text of the selected element and all its node
How do you update the text within an element using JavaScript?
textContent or innerText property
Is the event parameter of an event listener callback always useful?
generally useful but no
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 it may be more work and can’t depend on the DOM