0% found this document useful (0 votes)
19 views

Forms in HTML

Forms in HTML allow users to enter input that is then sent to a server. Common form elements include <input>, <label>, <select>, <option>, and <textarea>. The <input> element defines different types of form fields like text, password, radio buttons, checkboxes. The <label> element binds a label to a form field to help screen readers and improve usability. <select> creates a drop-down list and <option> defines the options. <textarea> defines a multi-line text input field specifying visible rows and columns.

Uploaded by

Ved Kanani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Forms in HTML

Forms in HTML allow users to enter input that is then sent to a server. Common form elements include <input>, <label>, <select>, <option>, and <textarea>. The <input> element defines different types of form fields like text, password, radio buttons, checkboxes. The <label> element binds a label to a form field to help screen readers and improve usability. <select> creates a drop-down list and <option> defines the options. <textarea> defines a multi-line text input field specifying visible rows and columns.

Uploaded by

Ved Kanani
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Forms in HTML

Forms in HTML

An HTML form is used to collect user <input type="text">


input. The user input is most often sent
to a server for processing. Here are the
mostly used forms elements <label for="lastName">

<select> and <option>

<textarea>
<input> types

<input type="button"> <input type="password">


<input type="checkbox"> <input type="radio">
<input type="color"> <input type="range">
<input type="date"> <input type="reset">
<input type="datetime-local"> <input type="search">
<input type="email"> <input type="submit">
<input type="file"> <input type="tel">
<input type="hidden"> <input type="text">
<input type="image"> <input type="time">
<input type="month"> <input type="url">
<input type="number"> <input type="week">
<label> element

The <label> tag defines a label for many form elements. The for attribute of
the <label> tag should be equal to the id attribute of the <input> element to
bind them together.

The <label> element is useful for screen-reader users, because the screen-
reader will read out loud the label when the user focus on the input element.

The <label> element also help users who have difficulty clicking on very small
regions (such as radio buttons or checkboxes) - because when the user clicks
the text within the <label> element, it toggles the radio button/checkbox.
<select> and <option>

The <select> element defines a drop-down list:


<textarea> element

The <textarea> element defines a multi-line input field (a text area):

The rows attribute specifies the visible number of lines in a text area.
The cols attribute specifies the visible width of a text area.

You might also like