Javascript-view-swapping Flashcards
What is the event.target?
element that is triggering event.
element that is interacted with.
What is the affect of setting an element to display: none?
- it turns off the display of an element so that it has no effect on layout.
What does the element.matches() method take as an argument and what does it return?
takes as an arguement (selector) and it returns a boolean if that selector was met.
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?
anytime you want to verify it is happening.
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?
have to go and adjust javascript –> add addeventlistener, function etc…
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?
willl need to write conditionals for every single node list.