dom-manipulation Flashcards
What is the className property of element objects?
tells us the current class and allows us to dynamically update class
How do you update the CSS class attribute of an element using JavaScript?
class name and assign new name
What is the textContent property of element objects?
it shows the text content of that element
How do you update the text within an element using JavaScript?
Is the event parameter of an event listener callback always useful?
useful but not always required
Would this assignment be simpler or more complicated if we didn’t use a variable to keep track of the number of clicks?
we would need query selecor
Why is storing information about a program in variables better than only storing it in the DOM?
DOM is dynamic not so good
Why is storing information about a program in variables better than only storing it in the DOM?
DOM is dynamic not so good