Interactive online courses HTML Academy
2026-03-09 14:05 Diff

The event was triggered, the message was output, and the form was sent. It’s just that we do not need to submit the form data. Our task is to display the data from the form on the same page.

We have already discussed default actions in this assignment. Back then we were working with links, but this time we are dealing with forms. The form submission is the default form action that we need to cancel. We will use evt.preventDefault() to do this.

Cancel the default action, try to submit the form again, and check that the data is no longer being sent.