JS VIEW SWAPPING Flashcards

1
Q

What is the event.target?

A

reference to the object onto which the event was dispatched

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the affect of setting an element to display: none?

A

The element is removed from the document flow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the element.matches() method take as an argument and what does it return?

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you retrieve the value of an element’s attribute?

A

element.getAttribute(‘string’ )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

At what steps of the solution would it be helpful to log things to the console?

A

Whenever you have a return value or a line of code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

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?

A

addEventListeners would be made for each tab and elements regarding the elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

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?

A

if else statements for each view and revise the function for each

How well did you know this?
1
Not at all
2
3
4
5
Perfectly