JS VIEW SWAPPING Flashcards
What is the event.target?
reference to the object onto which the event was dispatched
What is the affect of setting an element to display: none?
The element is removed from the document flow
What does the element.matches() method take as an argument and what does it return?
tests whether the element would be selected by the specified CSS selector.
selectors are taken in and returns a boolean depending if the element matches the selectors
How can you retrieve the value of an element’s attribute?
element.getAttribute(‘string’ )
At what steps of the solution would it be helpful to log things to the console?
Whenever you have a return value or a line of code
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?
addEventListeners would be made for each tab and elements regarding the elements
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?
if else statements for each view and revise the function for each