javascript-view-swapping Flashcards
What is the event.target?
element that is interacted with, triggering the event.
What is the effect of setting an element to display: none?
It removes it from the flow of the element
What does the element.matches() method take as an argument and what does it return?
Takes the string representing the selector and returns a Boolean.
How can you retrieve the value of an element’s attribute?
element.getAttribute()
At what steps of the solution would it be helpful to log things to the console?
All steps, as soon as something is selected.
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?
Multiple event listeners.
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’ll have to write series of conditionals and check to see if they match what is being targeted.