type attribute of the input tag (XHTML 1.1)

specifies the type of input control to be rendered

The type attribute allows the input tag to be a multipurpose tag for rendering different types of controls.

 

text

A standard input field for single lines of text:

password

Just like the text box, but characters are masked:

hidden

A hidden text box, for submitting invisible information along with the form (you can see it in the source):

checkbox

A checkbox allows the user to select multiple choices: Checkbox

radio

A radiobutton allows the user to select between a range of values: Radiobutton

submit

A submit control will submit the surrounding form:

reset

A reset control will reset all the fields of the surrounding form to the initial value:

button

A button control won't do anything by it self, and is mostly used for scripting purposes:

image

An image control allows you to create a button rendered as an image, using the src attribute:

file

The file control is for doing file uploads. The control only allows the user to select a local file - you will have to handle the processing of the file yourself:

 

Possible values

Value
text
password
checkbox
radio
submit
reset
file
hidden
image
button

type exists in these tags

Attribute Deprecated Description
a hyperlinks (anchor tag) 
button push button 
input form control 
li list item 
link a media-independent link 
object generic embedded object 
ol ordered list 
param named property value 
script script statements 
style style info 
ul unordered list 



© htmlpedia.net 2008 - 2012