JavaScript View Swapping Flashcards
What is the event.target?
The element the event is firing and is dispatching the event from
What is the affect of setting an element to display:none?
It makes it so the content is taken out of document flow and is hidden from view
What does the element.matches() method take as an argument and what does it return?
It takes in a selector and returns a boolean
How can you retrieve the value of an element’s attribute?
By using the getAttribute() method
At what steps of the solution would it be helpful to log things to the console?
Basically at all steps during a solution, just be logging things
If you were to add another tab and view to you HTML, but you didn’t use event delegation, how would your JavaScript code be written instead?
More event handlers on more specific elements would be implemented
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?
More conditionals having to compare elements to each other would have to be implemented.