VirtualMV/JavaScript/Forms/Home

Overview
As was seen in Example 1: (js1_11), a form allows us to create buttons on a web page that can request an action from a web user.

Example :.

However, this can be taken much further. The form element also allows us to request user input, and linking this with JavaScript allows us to validate what the user has entered. For example if we want the user to enter a valid email address we can check for the @ sign and dot.

To invoke JavaScript activity from a form we usually use a button to call a function

However, we can add JavaScript interaction to any form element using one of the following: