Hyper Text Markup Language Forms
Hyper Text Markup Language Forms
HTML Forms use the <form> tag to collect user input through various
interactive controls. These controls range from text fields, numeric
inputs, and email fields to password fields, checkboxes, radio buttons,
and submit buttons.
Syntax:
<form> <!--form elements--> </form>
Table of Content
• Form Elements
• Commonly Used Input Types in HTML Forms
• HTML Forms Example
• Basic HTML Forms
• Advance HTML Forms
Elements Descriptions
<label> It defines labels for <form> elements.
It is used to get input data from the form in various types such
<input>
as text, password, email, etc by changing its type.
• <head>
• <title>Html Forms</title>
• </head>
• <body>
• <h2>HTML Forms</h2>
• <form>
• <label for="username">Username:</label><br>
• <input type="text" id="username" name="username"><br><br>
• <label for="password">Password:</label><br>
• <input type="password" id="password" name="password"><br><br>
• </html>
Output:
Input Type Description
<input type=”text”> Defines a one-line text input field
Allows the user to enter a number. You can specify min, max, and
<input type=”number”> step attributes for range.
<input type=”checkbox”> Used for checkboxes where the user can select multiple options.