dom-manipulation Flashcards
What is the className property of element objects?
The className property of the Element contains the class name of an element and allow you set the class name.
How do you update the CSS class attribute of an element using JavaScript?
.className, another way is classList
What is the textContent property of element objects?
the textContent property is the text content of the node and its descent ( get or set the text content)
How do you update the text within an element using JavaScript?
.textContent property on the element.
Is the event parameter of an event listener callback always useful?
not always, it’s useful but not always have to use it.
Would this assignment be simpler or more complicated if we didn’t use a variable to keep track of the number of clicks?
it would be more complicated
Why is storing information about a program in variables better than only storing it in the DOM?
we can have more control by using the stored information directly instead of the text content or the dom.