Which function is used to prevent the default action of an event in jQuery?
-
A
preventDefault()
Correct answer
-
B
stopPropagation()
-
C
haltEvent()
-
D
cancelEvent()
Correct answer
A. preventDefault()
17 views
Explanation
The preventDefault() function is used to stop the default action of an event from occurring.
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ