O'Reilly logo

Serverless Single Page Apps by Ben Rady

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling User Input

The original idea behind HTML <form> elements was to give web pages a way to send user-supplied data back to a server.[36] The form attributes action and method allow you to specify where and how to send this data when the user clicks the Submit button in the form. While we don’t want to abandon the familiar look and feel of a form, we need a way to capture user input without submitting a request to a server. We want our application to prevent the form submission and take action entirely in the browser.

Now that our app is presenting problems to the users, we’re going to give the users a way to provide an answer. We’ll want them to enter the code for their answer, hit a button to check it, and then see the results displayed ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required