javascript-view-swapping Flashcards

1
Q

What is the event.target?

A

Element where the event occurs

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 won’t be displayed because it won’t get rendered. The document will treat it as if it didn’t exist along with child elements.

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

Takes a selector as a string for an argument and returns a Boolean value

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

getAttributes( ) method

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

Anytime you want to verify a value or to verify if the code is working correctly

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

Go back and add new event listener and possibly new event handler function for each tab.

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

The code would have to have multiple conditions for each tab.

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