javascript-view-swapping Flashcards
What is the event.target?
element where the event occurs.
What is the affect of setting an element to display: none?
Turns off the display of an element so that it has no effect on layout (the document is rendered as though the element did not exist). descendants elements also have their display turn off.
What does the element.matches() method take as an argument and what does it return?
It takes a string representing the selector to test as an argument.
Result is a Boolean.
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?
Any time you would like to check your code. After you create a variable, create a query, etc.
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?
addEventListener to each of the buttons/tabs
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?
Multiple conditions.