KEMBAR78
HTML Form Tags Notes | PDF
0% found this document useful (0 votes)
5 views2 pages

HTML Form Tags Notes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

HTML Form Tags Notes

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

HTML Form Tags & Details

1. <form> Tag
Used to create an HTML form.
Example:
<form action='submit.php' method='post'>
<!-- form elements go here -->
</form>
Attributes: action, method (GET/POST), target, autocomplete.

2. <input> Tag
Used for taking user input.
Common types: text, email, password, number, date, radio, checkbox, file, color, range, hidden,
submit, reset.

<input type='text' placeholder='Enter name'>


<input type='radio' name='gender' value='male'> Male

3. <label> Tag
Used to label input fields.
<label for='username'>Username:</label> <input type='text' id='username'
name='username'>

4. <textarea> Tag
Used for multi-line text input.
<textarea rows='4' cols='40' placeholder='Enter message'></textarea>

5. <select> & <option> Tags


Used for dropdown menus.
<select name='city'><option value='nagpur'>Nagpur</option></select>

6. <button> Tag
Used to create buttons.
<button type='submit'>Submit</button>

7. <fieldset> & <legend> Tags


Used to group related form elements.
<fieldset><legend>Personal Info</legend>...</fieldset>

8. <datalist> Tag
Provides predefined list of options.
<input list='browsers'><datalist id='browsers'><option
value='Chrome'></datalist>
9. <output> Tag
Displays calculated results.
<form
oninput='result.value=parseInt(a.value)+parseInt(b.value)'>...<output
name='result'></output></form>

Summary Table
Tag Purpose
<form> Creates form container
<input> Single-line input field
<textarea> Multi-line text field
<label> Describes input field
<select> / <option> Dropdown list
<button> Button (submit/reset/normal)
<fieldset> / <legend> Groups form elements
<datalist> Predefined list for input
<output> Displays result

You might also like