<input>: 입력 요소

번역이 완료되지 않았습니다. Please help translate this article from English

HTML <input> 요소는 웹 기반 양식에서 사용자의 데이터를 받을 수 있는 대화형 컨트롤을 생성합니다. 사용자 에이전트에 따라서 다양한 종류의 입력 데이터 유형과 컨트롤 위젯이 존재합니다. 입력 유형과 특성의 다양한 조합 가능성으로 인해, <input> 요소는 HTML에서 제일 강력하고 복잡한 요소 중 하나입니다.

<input> 유형

<input> 요소의 동작 방식은 type 특성에 따라 현격히 달라지므로, 각각의 유형은 별도의 참고 문서에서 더 자세히 확인할 수 있습니다. 특성을 지정하지 않은 경우, 기본값은 text입니다.

가능한 유형은 다음과 같습니다.

유형 설명 기본 예제 Spec
button 기본 행동을 가지지 않으며 value을 레이블로 사용하는 푸시 버튼.
checkbox 단일 값을 선택하거나 선택 해제할 수 있는 체크박스.
color 색을 지정할 수 있는 컨트롤. 브라우저가 지원하는 경우, 활성화 시 색상 선택기를 열어줍니다. HTML5
date 날짜(연월일, 시간 없음)를 지정할 수 있는 컨트롤. 브라우저가 지원하는 경우, 활성화 시 날짜를 선택할 수 있는 달력 등을 열어줍니다. HTML5
datetime-local 날짜와 시간을 지정할 수 있는 컨트롤. 시간대는 지정할 수 없습니다. 브라우저가 지원하는 경우, 활성화 시 날짜를 선택할 수 있는 달력과, 시계 등을 열어줍니다. HTML5
email 이메일 주소를 편집할 수 있는 필드. 텍스트 입력 필드처럼 보이지만 유효성 검증 매개변수가 존재하며, 브라우저와 장치가 동적 키보드를 지원하는 경우 이메일에 적합한 키보드를 보여줍니다. HTML5
file 파일을 지정할 수 있는 컨트롤. accept 특성을 사용하면 허용하는 파일 유형을 지정할 수 있습니다.
hidden 보이지 않지만 값은 서버로 전송하는 컨트롤. 오른쪽 칸에 예제가 있지만 숨겨져서 안보이네요!
image src 특성에 지정한 이미지로 나타나는 시각적 제출 버튼. 이미지의 src를 누락한 경우 alt 특성의 텍스트를 대신 보여줍니다.
month 연과 월을 지정할 수 있는 컨트롤. 시간대는 지정할 수 없습니다. HTML5
number

숫자를 입력하기 위한 컨트롤. 스피너를 표시하고 지원되는 기본 확인을 추가합니다. 몇몇 장치에서는 동적 키패드들과 숫자 키패드를 표시합니다.

HTML5
password

값이 가려진 한줄 텍스트 필드. 사이트가 안전하지 않으면 사용자에게 경고합니다.

radio

같은 name 값을 가진 여러개의 선택중에서 하나의 값을 선택하게 하는 라디오 버튼입니다.

range

정확한 값은 중요하지 않는 숫자를 입력하는 컨트롤. 디폴트 값이 중간값인 범위 위젯으로 표시합니다. 접속사 min 와 max 사이에 사용되며 수용가능한 값들의 범위를 정의합니다.

HTML5
reset 폼의 내용들을 디폴트값으로 초기화하는 버튼. 권장되지 않습니다.
search

검색문자열을 입력하는 한줄 텍스트 필드. 줄바꿈 문자는 입력값에서 자동으로 제거됩니다. 지원 브라우저에서 필드를 클리어하기 위해 사용되는 삭제 아이콘이 포함됩니다. 동적 키패드들이 있는 몇몇 장치에서 엔터키 대신에 검색 아이콘을 표시합니다.

HTML5
submit 폼을 전송하는 버튼
tel 전화번호를 입력하는 컨트롤. 몇몇 장치에서 동적 키패드들과 전화번호 입력기를 표시한다. HTML5
text

디폴트 값. 한줄의 텍스트 필드입니다. 새줄 문자는 입력값으로부터 자동으로 제거됩니다.

time 시간대가 없는 시간값을 입력하는 콘트롤 HTML5
url URL을 입력하는 필드. 텍스트 입력처럼 보이지만, 검증 매개변수가 있습니다. 동적 키보드들을 지원하는 브라우저와 장치들에 관련된 키보드가 있습니다. HTML5
week 시간대가 없는 주-년 값과 주의 값을 구성하는 날짜를 입력하는 컨트롤입니다. HTML5
퇴화한 값
datetime

UTC 시간대에 기반한 날짜와 시간(시,분,초 그리고 초의 분수)을 입력하는 콘트롤입니다.

HTML5

특성

<input> 요소가 강력한 이유는 바로 다양한 특성 때문입니다. 그 중에서도, 위의 표에서 확인할 수 있는 type 특성이 제일 중요합니다. 모든 <input> 요소는 유형에 상관하지 않고 HTMLInputElement 인터페이스에 기반하므로, 기술적으로는 모든 <input>이 동일한 특성을 가집니다. 그러나 사실 대부분의 특성은 일부 유형에서만 효과를 보입니다. 게다가, 어떤 특성은 유형별로 그 영향이 달라집니다.

This section provides a table listing all the attributes with a brief description. This table is followed by a list describing each attribute in greater detail, along with which input types they are associated with.Those that are common to most or all input types are defined in greater detail below. Attributes that are unique to particular input types—or attributes which are common to all input types but have special behaviors when used on a given input type—are instead documented on those types' pages. This element includes the global attributes. Those with extra importance as it relates to <input> are highlighted.

<input> 요소는 전역 특성과 다음 특성을 포함합니다.
특성 유형 설명
accept file Hint for expected file type in file upload controls
alt image alt attribute for the image type. Required for accessibiltiy
autocomplete all Hint for form autofill feature
autofocus all Automatically focus the form control when the page is loaded
capture file Media capture input method in file upload controls
checked radio, checkbox Whether the command or control is checked
dirname text, search Name of form field to use for sending the element's directionality in form submission
disabled all Whether the form control is disabled
form all Associates the control with a form element
formaction image, submit URL to use for form submission
formenctype image, submit Form data set encoding type to use for form submission
formmethod image, submit HTTP method to use for form submission
formnovalidate image, submit Bypass form control validation for form submission
formtarget image, submit Browsing context for form submission
height image Same as height attribute for <img>; vertical dimension
list almost all Value of the id attribute of the <datalist> of autocomplete options
max numeric types Maximum value
maxlength password, search, tel, text, url Maximum length (number of characters) of value
min numeric types Minimum value
minlength password, search, tel, text, url Minimum length (number of characters) of value
multiple email, file Boolean. Whether to allow multiple values
name all Name of the input form control. Submitted with the form as part of a name/value pair.
pattern password, text, tel Pattern the value must match to be valid
placeholder password, search, tel, text, url content to be appear in the form control when the form control is empty
readonly almost all Boolean. The value is not editable
required almost all Boolean. A value is required or must be check for the form to be submittable
size email, password, tel, text Size of the control
src image Same as src attribute for <img>; address of image resource
step numeric types Incremental values that are valid.
type all Type of input form control
value all Current value of the form control. Submitted with the form as part of a name/value pair.
width image Same as width attribute for <img>

A few additional non-standard attributes are listed following the descriptions of the standard attributes

Individual attributes

accept

Valid for the file input type only, the accept property defines which file types are selectable in a file upload control. See the file input type.

alt

Valid for the image button only, the alt attribute provides alternative text for the image, displaying the value of the attribute if the image src is missing or otherwise fails to load. See the image input type.

autocomplete

Not a Boolean attribute, the autocomplete attribute takes as its value a space separated string that describes what, if any, type of autocomplete functionality the input should provide. A typical implementation of autocomplete simply recalls previous values entered in the same input field, but more complex forms of autocomplete can exist. For instance, a browser could integrate with a device's contacts list to autocomplete email addresses in an email input field. See Values in The HTML autocomplete attribute for permitted values.

The autocomplete attribute is valid on hidden, text, search, url, tel, email, date, month, week, time, datetime-local, number, range, color and password. This attribute has no effect on input types that do not return numeric or text data, being valid for all input types except checkbox, radio, file, or any of the button types. See The HTML autocomplete attribute for additional information, including information on password security and how autocomplete is slightly different for hidden than for other input types.

autofocus

A Boolean attribute which, if present, indicates that the input should automatically have focus when the page has finished loading (or when the <dialog> containing the element has been displayed).

Note: An element with the autofocus attribute may gain focus before the DOMContentLoaded event is fired.

No more than one element in the document may have the autofocus attribute, and autofocus cannot be used on inputs of type hidden, because hidden inputs can't be focused. If put on more than one element, the first one with the attribute receives focus .

Warning: Automatically focusing a form control can confuse visually-impaired people using screen-reading technology and people with cognitive impairments. When autofocus is assigned, screen-readers "teleport" their user to the form control without warning them beforehand.

For better usability, avoid using autofocus. Automatically focusing on a form control can cause the page to scroll on load. The focus can also cause dynamic keyboards to display on some touch devices. While a screen reader will announce the label of the form control receiving focus, the screen reader will not announce anything before the label, and the sighted user on a small device will equally miss the context created by the preceding content.

capture

Introduced in the HTML Media Capture specification and valid for the file input type only, the capture attribute defines which media - microphone, video, or camera - should be used to capture a new file for upload with file upload control in supporting scenarios. See the file input type.

checked

Valid for both radio and checkbox types, checked is a Boolean attribute. If present on a radio type, it indicates that that radio button is the currently selected one in the group of same-named radio buttons. If present on a checkbox type, it indicates that the checkbox is checked by default (when the page loads). It does not indicate whether this checkbox is currently checked: if the checkbox’s state is changed, this content attribute does not reflect the change. (Only the HTMLInputElement’s checked IDL attribute is updated.)

Note: Unlike other input controls, a checkboxes and radio buttons value are only included in the submitted data if they are currently checked. If they are, the name and the value(s) of the checked controls are submitted.

For example, if a checkbox whose name is fruit has a value of cherry, and the checkbox is checked, the form data submitted will include fruit=cherry. If the checkbox isn't active, it isn't listed in the form data at all. The default value for checkboxes and radio buttons is on.

dirname

Valid for text and search input types only, the dirname attribute enables the submission of the directionality of the element. When included, the form control will submit with two name/value pairs: the first being the name and value, the second being the value of the dirname as the name with the value of ltr or rtl being set by the browser.

<form action="page.html" method="post">
  <label>Fruit: <input type="text" name="fruit" dirname="fruit.dir" value="cherry"></label>
  <input type="submit"/>
</form>
<!-- page.html?fruit=cherry&fruit.dir=ltr -->

When the form above is submitted, the input cause both the name / value pair of fruit=cherry and the dirname / direction pair of fruit.dir=ltr to be sent.

disabled

A Boolean attribute which, if present, indicates that the user should not be able to interact with the input. Disabled inputs are typically rendered with a dimmer color or using some other form of indication that the field is not available for use.

Specifically, disabled inputs do not receive the click event, and disabled inputs are not submitted with the form.

Note: Although not required by the specification, Firefox will by default persist the dynamic disabled state of an <input> across page loads. Use the autocomplete attribute to control this feature.

form

A string specifying the <form> element with which the input is associated (that is, its form owner). This string's value, if present, must match the id of a <form> element in the same document. If this attribute isn't specified, the <input> element is associated with the nearest containing form, if any.

The form attribute lets you place an input anywhere in the document but have it included with a form elsewhere in the document.

Note: An input can only be associated with one form.

formaction

Valid for the image and submit input types only. See the submit input type for more information.

formenctype

Valid for the image and submit input types only. See the submit input type for more information.

formmethod

Valid for the image and submit input types only. See the submit input type for more information.

formnovalidate

Valid for the image and submit input types only. See the submit input type for more information.

formtarget

Valid for the image and submit input types only. See the submit input type for more information.

height

Valid for the image input button only, the height is the height of the image file to display to represent the graphical submit button. See the image input type.

id

Global attribute valid for all elements, including all the input types, it defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking. The value is used as the value of the <label>'s for attribute to link the label with the form control. See the the label element below.

inputmode

Global value valid for all elements, it provides a hint to browsers as to the type of virtual keyboard configuration to use when editing this element or its contents. Values include none
text, tel, url, email, numeric, decimal, and search

list

The values of the list attribute is the id of a <datalist> element located in the same document. The <datalist> provides a list of predefined values to suggest to the user for this input. Any values in the list that are not compatible with the type are not included in the suggested options. The values provided are suggestions, not requirements: users can select from this predefined list or provide a different value.

It is valid on text, search, url, tel, email, date, month, week, time, datetime-local, number, range, and color.Per the specifications, the list attribute is not supported by the hidden, password, checkbox, radio, file, or any of the button types.

Depending on the browser, the user may see a custom color palette suggested, tic marks along a range, or even a input that opens like a select but allows for non-listed values. Check out the browser compatibility table for the other input types.

See the <datalist> element.

max

Valid for date, month, week, time, datetime-local, number, and range, it defines the greatest value in the range of permitted values. If the value entered into the element exceeds this, the element fails constraint validation. If the value of the max attribute isn't a number, then the element has no maximum value.

maxlength

Valid for text, search, url, tel, email, and password, it defines the maximum number of characters (as UTF-16 code units) the user can enter into the field. This must be an integer value 0 or higher. If no maxlength is specified, or an invalid value is specified, the field has no maximum length. This value must also be greater than or equal to the value of minlength.

The input will fail constraint validation if the length of the text entered into the field is greater than maxlength UTF-16 code units long. By default, browsers prevent users from entering more characters than allowed by the maxlength attribute. See Client-side validation for more information.

min

Valid for date, month, week, time, datetime-local, number, and range, it defines the most negative value in the range of permitted values. If the value entered into the element is less than this this, the element fails constraint validation. If the value of the min attribute isn't a number, then the element has no minimum value.

This value must be less than or equal to the value of the max attribute. If the min attribute is present by is not specified or is invalid, no min value is applied. If the min attribute is valid and a non-empty value is less than the minimum allowed by the min attribute, constraint validation will prevent form submission. See Client-side validation for more information.

minlength

Valid for text, search, url, tel, email, and password, it defines the minimum number of characters (as UTF-16 code units) the user can enter into the entry field. This must be an non-negative integer value smaller than or equal to the value specified by maxlength. If no minlength is specified, or an invalid value is specified, the input has no minimum length.

The input will fail constraint validation if the length of the text entered into the field is fewer than minlength UTF-16 code units long, preventing form submission. See Client-side validation for more information.

multiple

The Boolean multiple attribute, if set, means the user can enter comma separated email addresses in the email widget or can choose more than one file with the file input. See the email and file input type.

name

A string specifying a name for the input control. This name is submitted along with the control's value when the form data is submitted.

What's in a name

Consider the name a required attribute (even though it's not). If an input has no name specified, or name is empty, the input's value is not submitted with the form. (Disabled controls, unchecked radio buttons, unchecked checkboxes, and reset buttons are also not sent.)

There are two special cases:

  1. _charset_ : If used as the name of an <input> element of type hidden, the input's value is automatically set by the user agent to the character encoding being used to submit the form.
  2. isindex: For historical reasons, the name isindex is not allowed.
name and radio buttons

The name attribute creates a unique behavior for radio buttons.

Only one radio button in a same-named group of radio buttons can be checked at a time. Selecting any radio button in that group automatically deselects any currently-selected radio button in the same group. The value of that one checked radio button is sent along with the name if the form is submitted,

When tabbing into a series of same-named group of radio buttons, if one is checked, that one will receive focus. If they aren't grouped together in source order, if one of the group is checked, tabbing into the group starts when the first one in the group is encountered, skipping all those that aren't checked. In other words, if one is checked, tabbing skips the unchecked radio buttons in the group. If none are checked, the radio button group receives focus when the first button in the same name group is reached.

Once one of the radio buttons in a group has focus, using the arrow keys will navigate thru all the radio buttons of the same name, even if the radio buttons are not grouped together in the source order.

HTMLFormElement.elements

When an input element is given a name, that name becomes a property of the owning form element's HTMLFormElement.elements property. If you have an input whose name is set to guest and another whose name is hat-size, the following code can be used:

let form = document.querySelector("form");

let guestName = form.elements.guest;
let hatSize = form.elements["hat-size"];

When this code has run, guestName will be the HTMLInputElement for the guest field, and hatSize the object for the hat-size field.

Warning: You should avoid giving form elements a name that corresponds to a built-in property of the form, since you would then override the predefined property or method with this reference to the corresponding input.

pattern

The pattern attribute, when specified, is a regular expression that the input's value must match in order for the value to pass constraint validation. It must be a valid JavaScript regular expression, as used by the RegExp type, and as documented in our guide on regular expressions; the 'u' flag is specified when compiling the regular expression, so that the pattern is treated as a sequence of Unicode code points, instead of as ASCII. No forward slashes should be specified around the pattern text.

If the pattern attribute is present but is not specified or is invalid, no regular expression is applied and this attribute is ignored completely. If the pattern attribute is valid and a non-empty value does not match the pattern, constraint validation will prevent form submission.

Tip: If using the pattern attribute, inform the user about the expected format by including explanatory text nearby. You can also include a title attribute to explain what the requirements are to match the pattern; most browsers will display this title as as a tooltip The visible explanation is required for accessibilty. The tooltip is an enhancement.

See Client-side validation for more information.

placeholder

The placeholder attribute is a string that provides a brief hint to the user as to what kind of information is expected in the field. It should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message. The text must not include carriage returns or line feeds.

Note: The placeholder attribute is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content. See Labels and placeholders in <input>: The Input (Form Input) element for more information.

readonly

A Boolean attribute which, if present, indicates that the user should not be able to edit the value of the input. The readonly attribute is supported text, search, url, tel, email, date, month, week, time, datetime-local, number, and password input types.

See the HTML attribute: readonly for more information.

required

required is a Boolean attribute which, if present, indicates that the user must specify a value for the input before the owning form can be submitted. The required attribute is supported text, search, url, tel, email, date, month, week, time, datetime-local, number, password, checkbox, radio, and file.

See Client-side validation and the HTML attribute: required for more information.

size
Valid for email, password, tel, and text input types only. Specifies how much of the input is shown. Basically creates same result as setting CSS width property with a few specialities. The actual unit of the value depends on the input type. For password and text it's number of characters (or em units) and pixels for others. CSS width takes precedence over size attribute.
src

Valid for the image input button only, the src is string specifying the URL of the image file to display to represent the graphical submit button. See the image input type.

step

Valid for the numeric input types, including number, date/time input types, and range, the step attribute is a number that specifies the granularity that the value must adhere to.

If not explicitly included, step defaults to 1 for number and range, and 1 unit type (second, week, month, day) for the date/time input types. The value can must be a positive number - integer or float -- or the special value any, which means no stepping is implied, and any value is allowed (barring other constraints, such as min and max).

If any is not explicity set, valid values for the number, date/time input types, and range input types are equal to the basis for stepping - the min value and increments of the step value, up to the max value, if specified. For example, if we have <input type="number" min="10" step="2"> any even integer, 10 or great, is valid. If omitted, <input type="number">, any integer is valid, but floats, like 4.2, are not valid, as step defaults to 1. For 4.2 to be valid, step would have had to be set to any, 0.1, 0.2, or any the min value would have had to be a number ending in .2, such as <input type="number" min="-5.2">

Note: When the data entered by the user doesn't adhere to the stepping configuration, the value is considered invalid in contraint validation and will match the :invalid pseudoclass

The default stepping value for number inputs is 1, allowing only integers to be entered, unless the stepping base is not an integer. The default stepping value for time is 1 second, with 900 being equal to 15 minutes.

See Client-side validation for more information.

tabindex

Global attribute valid for all elements, including all the input types, an integer attribute indicating if the element can take input focus (is focusable), if it should participate to sequential keyboard navigation. As all input types except for input of type hidden are focusable, this attribute should not be used on form controls, because doing so would require the management of the focus order for all elements within the document with the risk of harming usability and accessibility if done incorrectly.

title

Global attribute valid for all elements, including all input types, containing a text representing advisory information related to the element it belongs to. Such information can typically, but not necessarily, be presented to the user as a tooltip. The title should NOT be used as the primary explanation of the purpose of the form control. Instead, use the <label> element with a for attribute set to the form control's id attribute. See Labels below.

type

A string specifying the type of control to render. For example, to create a checkbox, a value of checkbox is used. If omitted (or an unknown value is specified), the input type text is used, creating a plaintext input field.

Permitted values are listed in <input> types above.

value

The input control's value. When specified in the HTML, this is the initial value, and from then on it can be altered or retrieved at any time using JavaScript to access the respective HTMLInputElement object's value property. The value attribute is always optional, though should be considered mandatory for checkbox, radio, and hidden.

width

Valid for the image input button only, the width is the width of the image file to display to represent the graphical submit button. See the image input type.

Non-standard attributes

The following non-standard attributes are also available on some browsers. As a general rule, you should avoid using them unless it can't be helped.

Attribute Description
autocorrect A string indicating whether or not autocorrect is on or off. Safari only.
incremental Whether or not to send repeated search events to allow updating live search results while the user is still editing the value of the field. WebKit and Blink only (Safari, Chrome, Opera, etc.).
mozactionhint A string indicating the type of action that will be taken when the user presses the Enter or Return key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. Firefox for Android only.
orient Sets the orientation of the range slider. Firefox only.
results The maximum number of items that should be displayed in the drop-down list of previous search queries. Safari only.
webkitdirectory A Boolean indicating whether or not to only allow the user to choose a directory (or directories, if multiple is also present)
autocorrect

A Safari extension, the autocorrect attribute is a string which indicates whether or not to activate automatic correction while the user is editing this field. Permitted values are:

on
Enable automatic correction of typos, as well as processing of text substitutions if any are configured.
off
Disable automatic correction and text substitutions.
incremental

The Boolean attribute incremental is a WebKit and Blink extension (so supported by Safari, Opera, Chrome, etc.) which, if present, tells the user agent to process the input as a live search. As the user edits the value of the field, the user agent sends search events to the HTMLInputElement object representing the search box. This allows your code to update the search results in real time as the user edits the search.

If incremental is not specified, the search event is only sent when the user explicitly initiates a search (such as by pressing the Enter or Return key while editing the field).

The search event is rate-limited so that it is not sent more more frequently than an implementation-defined interval.

mozactionhint

A Mozilla extension, supported by Firefox for Android, which provides a hint as to what sort of action will be taken if the user presses the Enter or Return key while editing the field. This information is used to decide what kind of label to use on the Enter key on the virtual keyboard.

Note: This has been standardized as the global attribute enterkeyhint, but is not yet widely implemented. To see the status of the change being implemented in Firefox, see bug 1490661.

Permitted values are: go, done, next, search, and send. The browser decides, using this hint, what label to put on the enter key.

orient
results

The results attribute—supported only by Safari—is a numeric value that lets you override the maximum number of entries to be displayed in the <input> element's natively-provided drop-down menu of previous search queries.

The value must be a non-negative decimal number. If not provided, or an invalid value is given, the browser's default maximum number of entries is used.

webkitdirectory

The Boolean webkitdirectory attribute, if present, indicates that only directories should be available to be selected by the user in the file picker interface. See HTMLInputElement.webkitdirectory for additional details and examples.

Note: Though originally implemented only for WebKit-based browsers, webkitdirectory is also usable in Microsoft Edge as well as Firefox 50 and later. However, even though it has relatively broad support, it is still not standard and should not be used unless you have no alternative.

예제

A simple input box

<!-- A basic input -->
<input type="text" name="input" value="Type here">

A common use-case scenario

<!-- A common form that includes input tags -->
<form action="getform.php" method="get">
    <label>First name: <input type="text" name="first_name" /></label><br />
    <label>Last name: <input type="text" name="last_name" /></label><br />
    <label>E-mail: <input type="email" name="user_email" /></label><br />
    <input type="submit" value="Submit" />
</form>

명세

명세 상태 주석
HTML Living Standard
The definition of '<input>' in that specification.
Living Standard
HTML5
The definition of '<input>' in that specification.
Recommendation
HTML 4.01 Specification
The definition of '<form>' in that specification.
Recommendation

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
inputChrome Full support YesEdge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support 1WebView Android Full support 1Chrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support 1Samsung Internet Android Full support Yes
type="button"Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support 1WebView Android Full support YesChrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support 1.0
type="checkbox"Chrome Full support YesEdge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="color"Chrome Full support 20Edge Full support 14Firefox Full support 29
Notes
Full support 29
Notes
Notes Firefox doesn't yet support inputs of type color on Windows Touch.
IE No support NoOpera Full support 12Safari Full support 12.1WebView Android Full support 4.4Chrome Android Full support 25Firefox Android Full support 27Opera Android Full support 12Safari iOS Full support 12.2Samsung Internet Android Full support 1.5
type="date"Chrome Full support 20Edge Full support 12Firefox Full support 57IE No support NoOpera Full support 11Safari No support No
Notes
No support No
Notes
Notes The input type is recognized, but there is no date-specific control. See bug 119175.
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 57Opera Android Full support 11Safari iOS Full support 5Samsung Internet Android Full support Yes
type="datetime-local"Chrome Full support 20Edge Full support 12Firefox No support No
Notes
No support No
Notes
Notes See bug 888320 and TPE DOM/Date time input types.
IE No support NoOpera Full support 11Safari No support No
Notes
No support No
Notes
Notes The input type is recognized, but there is no date-specific control. See bug 200416.
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support 11Safari iOS Full support YesSamsung Internet Android Full support Yes
type="email"Chrome Full support 5Edge Full support 12Firefox Full support YesIE Full support 10Opera Full support 11Safari Full support YesWebView Android ? Chrome Android ? Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support 3.1
Notes
Full support 3.1
Notes
Notes Doesn't do validation, but instead offers a custom 'email' keyboard, which is designed to make entering email addresses easier.
Notes The custom 'email' keyboard does not provide a comma key, so users cannot enter multiple email addresses.
Notes Automatically applies a default style of opacity: 0.4 to disable textual <input> elements, including those of type 'email'. Other major browsers don't currently share this particular default style.
Samsung Internet Android ?
type="file"Chrome Full support 1Edge Full support 12Firefox Full support 1
Notes
Full support 1
Notes
Notes You can set as well as get the value of HTMLInputElement.files in all modern browsers; this was most recently added to Firefox, in version 57 (see bug 1384030).
IE Full support YesOpera Full support 11Safari Full support 1WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support 11Safari iOS Full support YesSamsung Internet Android Full support Yes
type="hidden"Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support 2Safari Full support 1WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="image"Chrome Full support YesEdge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android ? Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android ?
x-moz-errormessage attribute
ExperimentalDeprecatedNon-standard
Chrome No support NoEdge No support NoFirefox No support ? — 66IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support ? — 66Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
type="month"Chrome Full support 20Edge Full support 12Firefox No support No
Notes
No support No
Notes
Notes See bug 888320.
IE No support NoOpera Full support 11Safari No support No
Notes
No support No
Notes
Notes The input type is recognized, but there is no month-specific control. See bug 200416.
WebView Android Full support YesChrome Android Full support YesFirefox Android No support NoOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="number"Chrome Full support YesEdge Full support 12Firefox Full support YesIE Full support 10Opera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="password"Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 2Opera Full support 2Safari Full support 1WebView Android ? Chrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="radio"Chrome Full support YesEdge Full support 12Firefox Full support YesIE Full support YesOpera Full support YesSafari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="range"Chrome Full support 4Edge Full support 12Firefox Full support 23IE Full support 10Opera Full support 11Safari Full support 3.1WebView Android Full support 4.4
Full support 4.4
No support 2 — 4.4
Notes
Notes Pre-Chromium Android WebView recognizes the range type, but doesn't implement a range-specific control.
Chrome Android Full support 57Firefox Android Full support 52Opera Android Full support YesSafari iOS Full support 5.1Samsung Internet Android Full support 7.0
type="reset"Chrome Full support 1Edge Full support 12Firefox Full support 1
Notes
Full support 1
Notes
Notes Unlike other browsers, Firefox by default persists the dynamic disabled state of a <button> across page loads. Use the autocomplete attribute to control this feature.
IE Full support YesOpera Full support YesSafari Full support 1WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4
Notes
Full support 4
Notes
Notes Unlike other browsers, Firefox by default persists the dynamic disabled state of a <button> across page loads. Use the autocomplete attribute to control this feature.
Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="search"Chrome Full support 5Edge Full support 12Firefox Full support 4IE Full support 10Opera Full support 10.6Safari Full support 5WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="submit"Chrome Full support 1Edge Full support 12Firefox Full support 1
Notes
Full support 1
Notes
Notes Unlike other browsers, Firefox by default persists the dynamic disabled state of a <button> across page loads. Use the autocomplete attribute to control this feature.
IE Full support YesOpera Full support YesSafari Full support 1WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4
Notes
Full support 4
Notes
Notes Unlike other browsers, Firefox by default persists the dynamic disabled state of a <button> across page loads. Use the autocomplete attribute to control this feature.
Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="tel"Chrome Full support 3
Notes
Full support 3
Notes
Notes The field type doesn't demonstrate any special behavior.
Edge Full support 12Firefox Full support YesIE Full support 10Opera Full support 11Safari Full support 4
Notes
Full support 4
Notes
Notes The field type doesn't demonstrate any special behavior.
WebView Android Full support ≤37Chrome Android Full support 18Firefox Android Full support YesOpera Android Full support 11Safari iOS Full support 3Samsung Internet Android Full support 1.0
type="text"Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support YesOpera Full support YesSafari Full support 1WebView Android Full support YesChrome Android Full support YesFirefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="time"Chrome Full support 20Edge Full support 12Firefox Full support 57IE No support NoOpera Full support 10Safari No support No
Notes
No support No
Notes
Notes See bug 200416.
WebView Android Full support YesChrome Android Full support 25Firefox Android Full support 57Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support 1.5
type="url"Chrome Full support 1Edge Full support 12Firefox Full support YesIE Full support 10Opera Full support 11Safari Full support YesWebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes
type="week"Chrome Full support 20Edge Full support 12Firefox No support No
Notes
No support No
Notes
Notes See bug 888320.
IE No support NoOpera Full support 11Safari No support No
Notes
No support No
Notes
Notes See bug 200416.
WebView Android Full support YesChrome Android Full support YesFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support Yes

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.