Javascript View Swapping Flashcards
What is the event.target?
the target of the event
What is the affect of setting an element to display: none?
it hides it from the users view
What does the element.matches() method take as an argument and what does it return?
it takes a css selector and returns any element that matches the css selector
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
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 add the event to every new 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 have to manually check every single element on the page.