JavaScript-view-swapping Flashcards
What is the event.target?
The point of interaction
What is the effect of setting an element to display: none?
Hides the element by removing it from the document flow.
What does the element.matches( ) method take as an argument and what does it return?
Takes the selectorString is a string representing the selector to test and returns a boolean value
How can you retrieve the value of an element’s attribute?
getAttribute() method
At what steps of the solution would it be helpful to log things to the console?
Every step, lol
If you were to add another tab and view to your HTML, but you didn’t use event delegation, how would your JavaScript code be written instead?
Put an event listener on each of the elements… Using event.target… Find which element it was interacted with.
If you didn’t use a loop to conditionally show or hide the view in the page, how would your JavaScript code be written instead?
A lot of other conditional statement.s