jQuery Flashcards

1
Q

How do you get the text out of an HTML element?

A

by using .text()

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

How do you get the value out of an HTML input field?

A

by using .val()

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

What’s the difference between .text() and html()?

A

text() gets the combined text content of each element in the set of matched elements while .html() is used to retrieve info from jquery selector

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

What does .on() do?

A

attaches an event handler function for one or more events to the selected elements

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

What is jquery?

A

JS library for DOM to write less and be able to do more

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

What is the jQuery selector function?

A

$( )

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

What does the jQuery selector function return?

A

the list of elements

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

Why would someone use jQuery over vanilla JS?

A

less code, and easy to use. To chain actions together

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

What are some downsides from using jQuery over vanilla JS?

A

hides the complex parts of JS, one day it won’t be used anymore.

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

Why do we use the tag at the bottom of the body, instead of putting it inside the tag?

A

the elements need to be there 1st and HTML document loads top to bottom

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