JavaScript View Swapping Flashcards
What is the event.target?
It’s the element that the event is being activated on.
What is the affect of setting an element to display: none?
It disappears off the viewport.
What does the element.matches() method take as an argument and what does it return?
It takes a selector and returns if the element would be selected from that 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 time you create/modify a variable and have a conditional.
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 remove the