javascript-view-swapping Flashcards
What is the event.target?
The element that was interacted with.
What is the affect of setting an element to display: none?
The element is not displayed and it is removed from the document flow.
What does the element.matches( ) method take as an argument and what does it return?
A string representing the selector and return a boolean value.
How can you retrieve the value of an element’s attribute?
Using 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?
Using multiple event listeners.
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?
Using several if statements.