jQuery Flashcards
1
Q
What is a jQuery method for giving a new class to an HTML element
A
.addClass()
2
Q
What is a jQuery method for targeting the nearest ancestor of a certain element type?
A
.closest()
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();