elibraryportal Logo

HTML Forms

⟼ HTML Forms are collect different kinds of user input details like name, email address, phone numbers, or details like credit card information, and Other Details etc.

⟼ User input Date most often sent to the server processing. The <form> tag is used to create a HTML form.

Uses for Form Tags .

Let's see the list of tags below.

TagDescription
<form> HTML structure to enter.
<input>It is used for input control.
<textarea>It is used for multi-line input control.
<label>It is used for label element.
<fieldset>It is used for groups the related element in a form.
<legend>It defines a caption for a <fieldset> element.
<select>It is used a drop-down list.
<optgroup>It is used a group of related options in a drop-down list.
<option>It is used an option in a drop-down list.
<button>It is used a clickable button.

Syntax1:-

Syntax2:-


1) HTML <input> Tag.

It is used to create text fields, to take input Data from user.

An <input> tag can be display in many ways, depending on the type attribute below in list.

Type Description
<input type="text"> It is Displays a single-line text input field
<input type="radio"> It is Displays a radio button .
<input type="checkbox"> It is Displays a checkbox .
<input type="submit"> It is Displays a Form submit button
<input type="button"> It is Displays a Create clickable button

Syntax:-

Example:-

Output:-

HTML <input> Tag

2) HTML <textarea> Tag

<textarea> Tag is used to insert multiple-line text in a form.The <textarea> size depend on either using "rows" or "cols" attribute..

Where rows attribute specifies the visible number of lines in a text area.

Where cols attribute specifies the visible width of a text area.

Syntax:-

Example:-

Output:-

HTML <textarea> Tag

3) HTML Label Tag

HTML <label> tag is used to adding a label to a user interface form control.

Syntax:-

Example1:- (radio Button)

Output:-

HTML Label Tag Example

Example2:- (Checkbox Button)

Output:-

HTML Label Tag checkbox Example

4) HTML <fieldset> Tag:

HTML <fieldset> tag is used for grouping related information of a form.

The <fieldset> tag draws a box around the related information of a form.

Syntax:-

Example:-

Output:-

HTML HTML <fieldset>  Tag checkbox Example
Next TopicHTML Iframe