HTML Form Elements
HTML Form Elements
This chapter describes all HTML form elements.
The input Element
The most important form element is the input element.
The input element can be displayed in several ways, depending on the type attribute.
Example
<input name="firstname"type="text">
If the type attribute is omitted, the input field gets the default type: "text".
All the different input types are covered in the next chapter.
The textarea Element
The textarea element defines a multi-line input field (a text area):
Example
textarea name="messages"rows="12" cols="30"
The birds was playing in the garden.
The rows attribute specifies the visible number of lines in a text area.
The cols attribute specifies the visible width of a text area.
<option value="fiat"selected>Fiat
Visible Values:
Use the size attribute to specify the number of visible values:
Example
select name="cars"size="3"
<optionvalue="volvo">Volvo
<optionvalue="saab">Saab
<optionvalue="fiat">Fiat
<optionvalue="audi">Audi
The select Element
The select element defines a drop-down list:
Example
select name="cars"
<optionvalue="volvo">Volvo
<optionvalue="saab">Saab
<optionvalue="fiat">Fiat
<optionvalue="audi">Audi
The option elements defines an option that can be selected.
By default, the first item in the drop-down list is selected.
To define a pre-selected option, add the selected attribute to the option:
Example
Allow Multiple Selections:
Use the multiple attribute to allow the user to select more than one value:
Example
<select name="cars"size="4" multiple>
<optionvalue="volvo">Volvo
<optionvalue="saab">toyota
<optionvalue="fiat">volvo
<optionvalue="audi">diat
Leave HTML Form Elements to:
Read more #formelement posts
Best Posts From Md Robiul Islam
We have not curated any of rabiul21's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Md Robiul Islam
- ABOUT BANGLADESH
- Why Study JavaScript?
- Nice Doll
- Photography
- HTML5 Geolocation
- HTML Plug-ins
- HTML5 Audio
- HTML Multimedia
- HTML Multimedia
- HTML5 Canvas
- HTML5 Semantic Elements
- HTML5 New Elemen New
- HTML5 Browser Support
- HTML5 Introduction
- HTML Input Attributes
- HTML Form Elements
- HTML Forms
- HTML Symbol Entities
- HTML Entities
- HTML Computer Code Elements