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?
Hides the content by removing from the page
What does the element.matches() method take as an argument and what does it return?
Takes a string of a valid css selector; returns true is the element matches the selector, otherwise false
How can you retrieve the value of an element’s attribute?
getAttribute() method
At what steps of the solution would it be helpful to log things to the console?
When you create new variables to see their value; 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 need to create the new element, then add an event listener on each 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?
The code would have to have a condition for each of the tabs