DOM-manipulation Flashcards
What is theclassNameproperty of element objects?
gets and sets the value of theclassattributeof the specified element.
How do you update the CSS class attribute of an element using JavaScript?
className property
What is thetextContentproperty of element objects?
collects or update just the text that is in the containing element (and its children)
How do you update the text within an element using JavaScript?
textContent property
Is theeventparameter of an event listener callback always useful?
Not always
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?
You can access the information again by using the variable.