79187110

Date: 2024-11-14 01:17:10
Score: 1
Natty:
Report link

You're on the right track by thinking of preventDefault(). But in order to use it properly, you need to call it on the event object within the submit event handler. This will prevent the form default submit action from occurring.

So you should have written this code/line instead.

 event.preventDefault()
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Ali Asghar