javascript-view-swapping Flashcards
What is the event.target?
it gives the element node that was targeted upon the firing of an event
What is the affect of setting an element to display: none?
it makes it invisible; the element is not displayed and is completely removed from the document flow.
What does the element.matches() method take as an argument and what does it return?
it takes a selector string 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?
after each step
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?
you would have to event list every .tab element
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?
you would have to event list every individual .view container and assign it with if statements