Dom-Manipulation Flashcards
What is the className property of element objects?
- string containing the value of the class attribute of that element.
How do you update the CSS class attribute of an element using JavaScript?
Using .className property
What is the textContent property of element objects?
it is the property of an element that has text of that element.
How do you update the text within an element using JavaScript?
using the textContent property. we assign value using =
Is the event parameter of an event listener callback always useful?
It is not always useful. It is there for us if we need 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 unnecessary as it will take more steps.(More complicated).
Why is storing information about a program in variables better than only storing it in the DOM?
easier to access it (in the future) if we can store it in the variable.