js view swapping Flashcards
What is the event.target?
the element that received the input/event
What is the affect of setting an element to display: none?
Removes it from the document flow
What does the element.matches() method take as an argument and what does it return?
takes a CSS selector in the form of a string, returns boolean true/false
How can you retrieve the value of an element’s attribute?
element[attribute]
At what steps of the solution would it be helpful to log things to the console?
what?
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?
no change?
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?
when one tab is clicked, set display: none for all of them, then immediately set display: flex for the one clicked