Question discussion

How does one prevent a form from submitting when using JavaScript?

359461Medium DSSSB TGT Computer Science 0 replies 0 views
0
How does one prevent a form from submitting when using JavaScript?
  • Aevent.preventDefault()
  • Bform.submit()
  • Creturn false;
  • Devent.stopPropagation()
Correct answer: A

Explanation

event.preventDefault() stops the form from being submitted.

Discussion 0

Nobody has replied yet. Start the discussion!