From the course: JavaScript for Web Designers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Changing submission with events

Changing submission with events - JavaScript Tutorial

From the course: JavaScript for Web Designers

Start my 1-month free trial

Changing submission with events

- To create interactivity, we act on events. It's time to start looking at events how we listen for them, and subsequently take action. When a user interacts with something on a page, one or more events are fired. Clicking a button will trigger a click event, and an input event. Making a selection on a select box will fire an event called change and also an input event. Some events fire without obvious user interaction, like when a video is playing you'll get an event called time update that says how much time has elapsed in the playback of that video. Basically, there are lots and lots of events available in the browser. When we submit this form by clicking this estimate total button, the page reloads with some URL parameters added on here. We don't want to do that. We want JavaScript to take over control of this form, which means we need to listen to an event on that form. Specifically, the submit event. Let's…

Contents