JavaScript View Swapping Flashcards
What is the event.target?
reference to the element that the event is being called upon.
What is the affect of setting an element to display: none?
makes the item invisible. but still there.
What does the element.matches() method take as an argument and what does it return?
takes the selector as an argument and returns true or false
How can you retrieve the value of an element’s attribute?
getAttribute()
At what steps of the solution would it be helpful to log things to the console?
every step to make sure nothing is going wrong
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?
more event listeners to combat the changes in the use of it on the eventlistner on the children.
If you didn’t use a loop to conditionally show or hide the views in the page, how would your JavaScript code be written instead?
major amount of if statements