DOM Manipulation Flashcards
What is the className property of element objects?
gets and sets the value of the class attribute of the specified element
How do you update the CSS class attribute of an element using JavaScript?
.className
What is the textContent property of element objects?
Allows you to receive the text content or change it
How do you update the text within an element using JavaScript?
element .text content assigned to a new value
Is the event parameter of an event listener callback always useful?
Allows for an object to contain information without being thrown on to a browser or page instantly
and set it to an action ( not always useful)
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 , we would have to write out every line for each number
Why is storing information about a program in variables better than only storing it in the DOM?