Last updated 2017 March 13

Forms

W3C schools on HTML form elements and examples Chapter 18 of the online book Eloquent JavaScript by Marijn Haverbeke, discusses the DOM model.

Examples

Elements

The elements within a form can be used outside of a form for interaction with the user, where the interaction is implemented with JavaScript.

The purpose of the form element is to group form elements as a unit. The form button elements work on the form group as a unit. The general structure using the form element is the following.

<form name="formName"       // Identify the form
           method="POST"           // Preferred encoding for form data for transmission to a processing program
           action="URL for a php or cgi script to process the form data" >

      … The HTML for the contents of the form …

</form>

Form button elements

Form input elements