javascript-view-swapping Flashcards

1
Q

What is the event.target?

A

the target property of the event objet is the element that the action is being acted upon.

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

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

A

it will become invisible on the webpage
its present, but “gone”

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

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

A

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

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

A

element.getAttribute(‘attribute type’)

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(‘attribute type’)

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

at every step.

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

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

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

I would manually have to go through each element via adding if statements to check its value, one by one.

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