Dom manipulation Flashcards
What is the className property of element objects?
gives us the current classes on the object/ allows updates to classes
How do you update the CSS class attribute of an element using JavaScript?
object.className = newClass
What is the textContent property of element objects?
gives the current text of the element
How do you update the text within an element using JavaScript?
object.textContent = newText
Is the event parameter of an event listener callback always useful?
no
Would this assignment be simpler or more complicated if we didn’t use a variable to keep track of the number of clicks?
harder
Why is storing information about a program in variables better than only storing it in the DOM?
Its easier to recall if assigned to a variable