javascript-view-swapping Flashcards
What is the event.target?
the element that the user interacts with.
What is the affect of setting an element to display: none?
the element is hidden
What does the element.matches() method take as an argument and what does it return?
it takes an css selector as an argument and return a boolean value.
How can you retrieve the value of an element’s attribute?
The getAttribute() method
At what steps of the solution would it be helpful to log things to the console?
whenever you want to retrieve some data or test your functions.
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 will need to add event listener to every single tab 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?
you will need to check the condition element by element.