Forms and Keyboard Events

Learn how to work with forms and keyboard events.

Forms

Forms are a very common method of interacting with a web page and can be found on many sites.

Traditionally, when a form is submitted, it’s sent to a server where the information is processed using a “back-end” language, such as Python or Ruby. However, it’s possible to stop the form being sent to the server and to instead use JavaScript on the “front end” to process the information.

Submitting a form

Let’s start with a simple form that contains one input field and a button for submitting the form. Let’s add the following code in the index.html file:

Get hands-on with 1400+ tech skills courses.