HTML <input> Tag with the 'type' Attribute

<form name="myForm" action="https://www.PuStudy.Com/resources/html-forms-action.html">
	
<input type="range" name="myField">

<button>Submit</button>

</form>

The above example demonstrates usage of the <input> element with the type attribute.

The type attribute controls the data type (and associated control) of the element. The default value is text. In other words, if the type attribute is not present, the input control will be a text control.

Possible Values

The type attribute accepts the following values.

ValueData TypeControl Type
hiddenAn arbitrary stringN/A
textText with no line breaksText field
searchText with no line breaksText field
telText with no line breaksText field
urlAn absolute IRIText field
emailAn email address or list of email addressesText field
passwordText with no line breaks (sensitive information)Text field that obscures data entry (eg, hides the password by using asterisks (******) or similar)
datetimeA date and time (year, month, day, hour, minute, second, fraction of a second) with the time zone set to UTCDate and time control
dateA date (year, month, day) with no time zoneDate control
monthA date consisting of a year and a month with no time zoneA month control
weekA date consisting of a week-year number and a week number with no time zoneA week control
timeA time (hour, minute, seconds, fractional seconds) with no time zoneA time control
datetime-localA date and time (year, month, day, hour, minute, second, fraction of a second) with no time zoneDate and time control
numberA numerical valueText field or spinner control
rangeA numerical value, with the extra semantic that the exact value is not importantSlider control or similar
colorAn sRGB color with 8-bit red, green, and blue componentsA color well. Enables the user to select a color.
checkboxA set of zero or more values from a predefined listCheckbox
radioAn enumerated valueRadio button
fileZero or more files each with a MIME type and optionally a file nameA label and a button
submitAn enumerated value, with the extra semantic that it must be the last value selected and initiates form submissionButton
imageA coordinate, relative to a particular image's size, with the extra semantic that it must be the last value selected and initiates form submissionEither a clickable image, or a button
resetN/AButton
buttonN/AButton