javascript-view-swapping Flashcards
What is the event.target?
the target property of the event objet is the element that the action is being acted upon.
What is the affect of setting an element to display: none?
it will become invisible on the webpage
its present, but “gone”
What does the element.matches() method take as an argument and what does it return?
the element.matches() method takes a css selector and returns a boolean value reliant upon whether or not the argument is equal to the object matches is being called upon
How can you retrieve the value of an element’s attribute?
element.getAttribute(‘attribute type’)
How can you retrieve the value of an element’s attribute?
element.getAttribute(‘attribute type’)
At what steps of the solution would it be helpful to log things to the console?
at 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?
i would have to create a brand new event listener and function each time
do ur best to write code that does not need to be changed when new code is added
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?
I would manually have to go through each element via adding if statements to check its value, one by one.