You are here: Reference > HTML > attributes > type (input)

type attribute (input)

Browser support:
Sets the type of the input element.
JavaScript page for this attribute: type. You can find other example(s) there.

Possible values:

String that sets the type of the input element.
One of the following values:
button
The element is a button control. See the input:button element for details.
checkbox
The element is a check box control. See the input:checkbox element for details.
file
The element is a file selector object with a single-line text input control and a browse button. See the input:file element for details.
hidden
The element is a hidden text control. See the input:hidden element for details.
image
The element is an image control. See the input:image element for details.
password
The element is a single-line text input control, except that text is rendered in such a way as to hide the characters. See the input:password element for details.
radio
The element is a radio button control. See the input:radio element for details.
range
The element is a slider control. See the input:range element for details.
reset
The element is a reset button. Clicking on a reset button resets all controls in the form to their initial values. See the input:reset element for details.
search
The element is a single-line text input control with a search history dropdown list. See the input:search element for details.
submit
The element is a submit button. Clicking on a submit button sends the named contents of the form. See the input:submit element for details.
text
Default. The element is a single-line text input control. See the input:text element for details.
Default: text.

Example HTML code 1:

This example illustrates the use of the type attribute:
<input type="text" name="firstname" /><br />
<input type="radio" /><br />
<input type="checkbox" />
Did you find this example helpful? yes no

Supported by tags:

External links:

User Contributed Comments

Post Content

Post Content