<form> to get user input
Forms are the HTML mechanism for gathering input from the user.
To create a basic form, you need three elements: the form, input, and button elements.
<!DOCTYPE HTML> <html> <head> <title>Example</title> </head> <body> <form method="post" action="http://yourServer/form"> <input name="fave"/> <button>Submit Vote</button> </form> </body> </html>
The action attribute specifies where the browser should send the data when the form is submitted. If the action attribute is not set, the browser sends the data to the same URL that the HTML document was loaded from.Click to view this demo.
HTML CSS Book
- <form> to get user input
- Using the base Element to Set a Destination for Form Data
- Configuring the HTTP method Attribute for Form element
- Configuring the Form Data Encoding
- Controlling Form Completion
- Specifying a Target for the Form Response
- Setting the Name of the Form
- Adding Labels to a Form
- Automatically Focusing on an input Element
- Disabling Individual input Elements
- Form Elements Outside the Form