jQuery Flashcards

1
Q

What is a jQuery method for giving a new class to an HTML element

A

.addClass()

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

What is a jQuery method for targeting the nearest ancestor of a certain element type?

A

.closest()

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

What is a jQuery method for setting a form to its original values?

A

.reset()

Note: you will may need an index for the form. I haven’t studied if there are ways to just target more specifically.

(‘form’)[0].reset();

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