aboutsummaryrefslogtreecommitdiff
path: root/files/ko/web/html/element/input/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/ko/web/html/element/input/index.html')
-rw-r--r--files/ko/web/html/element/input/index.html865
1 files changed, 865 insertions, 0 deletions
diff --git a/files/ko/web/html/element/input/index.html b/files/ko/web/html/element/input/index.html
new file mode 100644
index 0000000000..8ff435e12d
--- /dev/null
+++ b/files/ko/web/html/element/input/index.html
@@ -0,0 +1,865 @@
+---
+title: '<input>: 입력 요소'
+slug: Web/HTML/Element/Input
+tags:
+ - Element
+ - Forms
+ - HTML
+ - HTML forms
+ - HTML input tag
+ - Reference
+ - Web
+translation_of: Web/HTML/Element/input
+---
+<div>{{HTMLRef}}</div>
+
+<p><span class="seoSummary"><strong>HTML <code>&lt;input&gt;</code> 요소</strong>는 웹 기반 양식에서 사용자의 데이터를 받을 수 있는 대화형 컨트롤을 생성합니다.</span> {{glossary("user agent", "사용자 에이전트")}}에 따라서 다양한 종류의 입력 데이터 유형과 컨트롤 위젯이 존재합니다. 입력 유형과 특성의 다양한 조합 가능성으로 인해, <code>&lt;input&gt;</code> 요소는 HTML에서 제일 강력하고 복잡한 요소 중 하나입니다.</p>
+
+<div>{{EmbedInteractiveExample("pages/tabbed/input-text.html", "tabbed-shorter")}}</div>
+
+
+
+<h2 id="&lt;input>_유형"><code>&lt;input&gt;</code> 유형</h2>
+
+<p><code>&lt;input&gt;</code> 요소의 동작 방식은 {{htmlattrxref("type")}} 특성에 따라 현격히 달라지므로, 각각의 유형은 별도의 참고 문서에서 더 자세히 확인할 수 있습니다. 특성을 지정하지 않은 경우, 기본값은 <code>text</code>입니다.</p>
+
+<p>가능한 유형은 다음과 같습니다.</p>
+
+<table class="standard-table">
+ <colgroup>
+ <col>
+ <col style="width: 50%;">
+ <col>
+ </colgroup>
+ <thead>
+ <tr>
+ <th>유형</th>
+ <th>설명</th>
+ <th>기본 예제</th>
+ <th>Spec</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{HTMLElement("input/button", "button")}}</td>
+ <td>기본 행동을 가지지 않으며 {{htmlattrxref("value", "input")}}을 레이블로 사용하는 푸시 버튼.</td>
+ <td id="examplebutton">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="button" name="button" /&gt;</pre>
+ {{EmbedLiveSample("examplebutton",200,55,"","", "nobutton")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/checkbox", "checkbox")}}</td>
+ <td>단일 값을 선택하거나 선택 해제할 수 있는 체크박스.</td>
+ <td id="examplecheckbox">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="checkbox" name="checkbox"/&gt;</pre>
+ {{EmbedLiveSample("examplecheckbox",200,55,"","", "nobutton")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/color", "color")}}</td>
+ <td>색을 지정할 수 있는 컨트롤. 브라우저가 지원하는 경우, 활성화 시 색상 선택기를 열어줍니다.</td>
+ <td id="examplecolor">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="color" name="color"/&gt;</pre>
+ {{EmbedLiveSample("examplecolor",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/date", "date")}}</td>
+ <td>날짜(연월일, 시간 없음)를 지정할 수 있는 컨트롤. 브라우저가 지원하는 경우, 활성화 시 날짜를 선택할 수 있는 달력 등을 열어줍니다.</td>
+ <td id="exampledate">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="date" name="date"/&gt;</pre>
+ {{EmbedLiveSample("exampledate",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/datetime-local", "datetime-local")}}</td>
+ <td>날짜와 시간을 지정할 수 있는 컨트롤. 시간대는 지정할 수 없습니다. 브라우저가 지원하는 경우, 활성화 시 날짜를 선택할 수 있는 달력과, 시계 등을 열어줍니다.</td>
+ <td id="exampledtl">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="datetime-local" name="datetime-local"/&gt;</pre>
+ {{EmbedLiveSample("exampledtl",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/email", "email")}}</td>
+ <td>이메일 주소를 편집할 수 있는 필드. 텍스트 입력 필드처럼 보이지만 유효성 검증 매개변수가 존재하며, 브라우저와 장치가 동적 키보드를 지원하는 경우 이메일에 적합한 키보드를 보여줍니다.</td>
+ <td id="exampleemail">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="email" name="email"/&gt;</pre>
+ {{EmbedLiveSample("exampleemail",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/file", "file")}}</td>
+ <td>파일을 지정할 수 있는 컨트롤. {{htmlattrxref("accept", "input")}} 특성을 사용하면 허용하는 파일 유형을 지정할 수 있습니다.</td>
+ <td id="examplefile">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="file" accept="image/*, text/*" name="file"/&gt;</pre>
+ {{EmbedLiveSample("examplefile",'100%',55,"","", "nobutton")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/hidden", "hidden")}}</td>
+ <td>보이지 않지만 값은 서버로 전송하는 컨트롤. 오른쪽 칸에 예제가 있지만 숨겨져서 안보이네요!</td>
+ <td></td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/image", "image")}}</td>
+ <td><code>src</code> 특성에 지정한 이미지로 나타나는 시각적 제출 버튼. 이미지의 {{anch('src')}}를 누락한 경우 {{anch('alt')}} 특성의 텍스트를 대신 보여줍니다.</td>
+ <td id="exampleimage">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="image" name="image" src="" alt="image input"/&gt;</pre>
+ {{EmbedLiveSample("exampleimage",200,55,"","", "nobutton")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/month", "month")}}</td>
+ <td>연과 월을 지정할 수 있는 컨트롤. 시간대는 지정할 수 없습니다.</td>
+ <td id="examplemonth">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="month" name="month"/&gt;</pre>
+ {{EmbedLiveSample("examplemonth",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/number", "number")}}</td>
+ <td>
+ <p>숫자를 입력하기 위한 컨트롤. 스피너를 표시하고 지원되는 기본 확인을 추가합니다. 몇몇 장치에서는 동적 키패드들과 숫자 키패드를 표시합니다.</p>
+ </td>
+ <td id="examplenumber">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="number" name="number"/&gt;</pre>
+ {{EmbedLiveSample("examplenumber",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/password", "password")}}</td>
+ <td>
+ <p>값이 가려진 한줄 텍스트 필드. 사이트가 안전하지 않으면 사용자에게 경고합니다.</p>
+ </td>
+ <td id="examplepassword">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="password" name="password"/&gt;</pre>
+ {{EmbedLiveSample("examplepassword",200,55,"","", "nobutton")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/radio", "radio")}}</td>
+ <td>
+ <p>같은 {{anch('name')}} 값을 가진 여러개의 선택중에서 하나의 값을 선택하게 하는 라디오 버튼입니다.</p>
+ </td>
+ <td id="exampleradio">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="radio" name="radio"/&gt;</pre>
+ {{EmbedLiveSample("exampleradio",200,55,"","", "nobutton")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/range", "range")}}</td>
+ <td>
+ <p>값이 가려진 숫자를 입력하는 컨트롤. 디폴트 값이 중간값인 범위 위젯으로 표시합니다. 접속사 {{anch('min')}} 와 {{anch('max')}} 사이에 사용되며 수용가능한 값의 범위를 정의합니다.</p>
+ </td>
+ <td id="examplerange">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="range" name="range" min="0" max="25"/&gt;</pre>
+ {{EmbedLiveSample("examplerange",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/reset", "reset")}}</td>
+ <td>양식의 내용을 디폴트값(기본값)으로 초기화하는 버튼. 권장되지 않습니다.</td>
+ <td id="examplereset">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="reset" name="reset"/&gt;</pre>
+ {{EmbedLiveSample("examplereset",200,55,"","", "nobutton")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/search", "search")}}</td>
+ <td>
+ <p>검색문자열을 입력하는 한줄 텍스트 필드. 줄바꿈 문자는 입력값에서 자동으로 제거됩니다. 지원 브라우저에서 필드를 클리어하기 위해 사용되는 삭제 아이콘이 포함됩니다. 동적 키패드들이 있는 몇몇 장치에서 엔터키 대신에 검색 아이콘을 표시합니다.</p>
+ </td>
+ <td id="examplesearch">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="search" name="search"/&gt;</pre>
+ {{EmbedLiveSample("examplesearch",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/submit", "submit")}}</td>
+ <td>양식을 전송하는 버튼</td>
+ <td id="examplesubmit">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="submit" name="submit"/&gt;</pre>
+ {{EmbedLiveSample("examplesubmit",200,55,"","", "nobutton")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/tel", "tel")}}</td>
+ <td>전화번호를 입력하는 컨트롤. 몇몇 장치에서 동적 키패드들과 전화번호 입력기를 표시한다.</td>
+ <td id="exampletel">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="tel" name="tel"/&gt;</pre>
+ {{EmbedLiveSample("exampletel",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/text", "text")}}</td>
+ <td>
+ <p>디폴트 값. 한줄의 텍스트 필드입니다. 새줄 문자는 입력값으로부터 자동으로 제거됩니다.</p>
+ </td>
+ <td id="exampletext">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="text" name="text"/&gt;</pre>
+ {{EmbedLiveSample("exampletext",200,55,"","", "nobutton")}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/time", "time")}}</td>
+ <td>시간대가 없는 시간값을 입력하는 콘트롤</td>
+ <td id="exampletime">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="time" name="time"/&gt;</pre>
+ {{EmbedLiveSample("exampletime",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/url", "url")}}</td>
+ <td>URL을 입력하는 필드. 텍스트 입력처럼 보이지만, 검증 매개변수가 있습니다. 동적 키보드들을 지원하는 브라우저와 장치들에 관련된 키보드가 있습니다.</td>
+ <td id="exampleurl">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="url" name="url"/&gt;</pre>
+ {{EmbedLiveSample("exampleurl",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/week", "week")}}</td>
+ <td>시간대가 없는 주-년 값과 주의 값을 구성하는 날짜를 입력하는 컨트롤입니다.</td>
+ <td id="exampleweek">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="week" name="week"/&gt;</pre>
+ {{EmbedLiveSample("exampleweek",200,55,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ <tr>
+ <th colspan="4">퇴화한 값</th>
+ </tr>
+ <tr>
+ <td>{{HTMLElement("input/datetime", "datetime")}}</td>
+ <td>
+ <p>{{deprecated_inline}} {{obsolete_inline}} UTC 시간대에 기반한 날짜와 시간(시,분,초 그리고 초의 분수)을 입력하는 콘트롤입니다.</p>
+ </td>
+ <td id="exampledatetime">
+ <pre class="brush: html hidden notranslate">
+&lt;input type="datetime" name="datetime"/&gt;</pre>
+ {{EmbedLiveSample("exampledatetime",200,75,"","", "nobutton")}}</td>
+ <td>{{HTMLVersionInline("5")}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="속성">속성</h2>
+
+<p><code>&lt;input&gt;</code> 요소가 강력한 이유는 바로 다양한 속성 때문입니다. 그 중에서도, 위의 표에서 확인할 수 있는 {{htmlattrxref("type", "input")}} 속성이 제일 중요합니다. 모든 <code>&lt;input&gt;</code> 요소는 유형에 상관하지 않고 {{domxref("HTMLInputElement")}} 인터페이스에 기반하므로, 기술적으로는 모든 <code>&lt;input&gt;</code>이 동일한 속성을 가집니다. 그러나 사실 대부분의 속성은 일부 유형에서만 효과를 보입니다. 게다가, 어떤 속성은 유형별로 그 영향이 달라집니다.</p>
+
+<p>여기에서는 모든 속성값들에 대해 간략한 설명을 담은 표를 제공합니다. 이 표 다음에는 각각의 속성을 더욱 상세하게 설명하는 목록이 나오는데, 그들이 연관된 input 유형과 함께 나옵니다. 대부분의 혹은 모든 input 유형에 공통적인 속성들은 그 아래 더욱 상세하게 설명되어 있습니다. 몇몇 input 유형에만 특정하게 해당하는 속성들이나 모든 유형에 공통적으로 해당하지만 특정 유형에 사용될 때 특정한 행동양식을 나타내는 속성들은 그 유형의 해당 페이지에 대신 기술되어 있습니다. 이 요소에는 글로벌 속성들도 포함됩니다. input에 관련된 특별히 중요한 속성들은 하이라이트로 표시되었습니다. </p>
+
+<table class="standard-table">
+ <caption>{{htmlelement('input')}} 요소는 전역 속성(Global Attributes)과 다음 특성을 포함합니다.</caption>
+ <thead>
+ <tr>
+ <th scope="col">특성</th>
+ <th scope="col">유형</th>
+ <th scope="col">설명</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{anch('htmlattrdefaccept', 'accept')}}</td>
+ <td>file</td>
+ <td>파일을 업로드 컨트롤에서 기대하는 파일 유형을 암시</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefalt', 'alt')}}</td>
+ <td>image</td>
+ <td>이미지 유형에 대한 대체 속성. accessibiltiy 측면에서 필요.</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefautocomplete', 'autocomplete')}}</td>
+ <td>all</td>
+ <td>양식 자동생성 기능 (form autofill) 암시</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefautofocus', 'autofocus')}}</td>
+ <td>all</td>
+ <td>페이지가 로딩될때 양식 제어에 오토포커스</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefcapture', 'capture')}}</td>
+ <td>file</td>
+ <td>파일 업로드 제어에서 input 방식에서 미디어 capture </td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefchecked', 'checked')}}</td>
+ <td>radio, checkbox</td>
+ <td>커맨드나 컨트롤이 체크 되었는지의 여부</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefdirname', 'dirname')}}</td>
+ <td>text, search</td>
+ <td>양식 전송시 요소의 방향성을 전송할 때 양식 필드의 Name</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefdisabled', 'disabled')}}</td>
+ <td>all</td>
+ <td>양식 컨트롤이 비활성화되었는지의 여부</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefform', 'form')}}</td>
+ <td>all</td>
+ <td>컨트롤을 양식 요소와 연결</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefformaction', 'formaction')}}</td>
+ <td>image, submit</td>
+ <td>양식 전송시 URL 사용하기</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefformenctype', 'formenctype')}}</td>
+ <td>image, submit</td>
+ <td>양식의 데이터 인코딩 유형이 양식 전송시 사용될 것</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefformmethod', 'formmethod')}}</td>
+ <td>image, submit</td>
+ <td>양식 전송시 HTTP 방식을 사용</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefformnovalidate', 'formnovalidate')}}</td>
+ <td>image, submit</td>
+ <td>양식 전송시 양식 컨트롤 확인을 무시하기</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefformtarget', 'formtarget')}}</td>
+ <td>image, submit</td>
+ <td>양식 전송시 브라우징 맥락</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefheight', 'height')}}</td>
+ <td>image</td>
+ <td>이미지 높이에서  <code>height</code> 속성과 같음</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdeflist', 'list')}}</td>
+ <td>almost all</td>
+ <td>datalist 자동입력 옵션의 id 속성값</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefmax', 'max')}}</td>
+ <td>numeric types</td>
+ <td>최대값</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefmaxlength', 'maxlength')}}</td>
+ <td>password, search, tel, text, url</td>
+ <td><code>value</code>의 최대 길이 (문자수) </td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefmin', 'min')}}</td>
+ <td>numeric types</td>
+ <td>최소값</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefminlength', 'minlength')}}</td>
+ <td>password, search, tel, text, url</td>
+ <td><code>value</code>의 최소 길이 (문자수)</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefmultiple', 'multiple')}}</td>
+ <td>email, file</td>
+ <td>불리언값. 여러 값을 허용할지의 여부</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefname', 'name')}}</td>
+ <td>all</td>
+ <td>input 양식 컨트롤의 이름. 이름/값 짝(name/value pair)의 일부로서 양식과 함께 전송된다</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefpattern', 'pattern')}}</td>
+ <td>password, text, tel</td>
+ <td><code>value</code> 가 유효하기 위해 일치해야 하는 패턴</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefplaceholder', 'placeholder')}}</td>
+ <td>password, search, tel, text, url</td>
+ <td>양식 컨트롤이 비어있는 때 양식 컨트롤에 나타나는 내용</td>
+ </tr>
+ <tr>
+ <td><a href="/en-US/docs/Web/HTML/Attributes/readonly">readonly</a></td>
+ <td>almost all</td>
+ <td>불리언값. 이 값은 수정이 불가능함</td>
+ </tr>
+ <tr>
+ <td><a href="/en-US/docs/Web/HTML/Attributes/required">required</a></td>
+ <td>almost all</td>
+ <td>불리언값. 양식이 전송되기 위해서 반드시 입력하거나 확인이 필요한 값</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefsize', 'size')}}</td>
+ <td>email, password, tel, text</td>
+ <td>컨트롤의 크기</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefsrc', 'src')}}</td>
+ <td>image</td>
+ <td>이미지 출처의 주소에서 <code>src</code> 와 같은 속성</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefstep', 'step')}}</td>
+ <td>numeric types</td>
+ <td>유효한 증분적인 (Incremental)값</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdeftype', 'type')}}</td>
+ <td>all</td>
+ <td>input 양식 컨트롤의 유형</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefvalue', 'value')}}</td>
+ <td>all</td>
+ <td>양식 컨트롤의 현재 값. 이름/값 짝(name/value pair)의 일부로서 양식과 함께 전송된다</td>
+ </tr>
+ <tr>
+ <td>{{anch('htmlattrdefwidth', 'width')}}</td>
+ <td>image</td>
+ <td>이미지의  <code>width</code> 속성과 같다</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>A few additional non-standard attributes are listed following the descriptions of the standard attributes</p>
+
+<h3 id="개별_속성">개별 속성</h3>
+
+<dl>
+ <dt id="htmlattrdefaccept">{{htmlattrdef("accept")}}</dt>
+ <dd>
+ <p>Valid for the <code>file</code> input type only, the <code>accept</code> property defines which file types are selectable in a <code>file</code> upload control. See the {{HTMLElement("input/file", "file")}} input type.</p>
+ </dd>
+ <dt id="htmlattrdefalt">{{htmlattrdef("alt")}}</dt>
+ <dd>
+ <p>Valid for the <code>image</code> button only, the alt attribute provides alternative text for the image, displaying the value of the attribute if the image {{anch("src")}} is missing or otherwise fails to load. See the {{HTMLElement("input/image", "image")}} input type.</p>
+ </dd>
+ <dt id="htmlattrdefautocomplete">{{htmlattrdef("autocomplete")}}</dt>
+ <dd>
+ <p><strong>Not</strong> a Boolean attribute, the <code><a href="/en-US/docs/Web/HTML/Attributes/autocomplete">autocomplete</a></code> 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 {{SectionOnPage("/en-US/docs/Web/HTML/Attributes/autocomplete", "Values")}} for permitted values.</p>
+
+ <p>The <code>autocomplete</code> attribute is valid on <code>hidden</code>, <code>text</code>, <code>search</code>, <code>url</code>, <code>tel</code>, <code>email</code>, <code>date</code>, <code>month</code>, <code>week</code>, <code>time</code>, <code>datetime-local</code>, <code>number</code>, <code>range</code>, <code>color</code> and <code>password</code>. This attribute has no effect on input types that do not return numeric or text data, being valid for all input types except <code>checkbox</code>, <code>radio</code>, <code>file</code>, or any of the button types. See <a href="/en-US/docs/Web/HTML/Attributes/autocomplete">The HTML autocomplete attribute</a> for additional information, including information on password security and how <code>autocomplete</code> is slightly different for <code>hidden</code> than for other input types.</p>
+ </dd>
+ <dt id="htmlattrdefautofocus">{{htmlattrdef("autofocus")}}</dt>
+ <dd>
+ <p>A Boolean attribute which, if present, indicates that the input should automatically have focus when the page has finished loading (or when the {{HTMLElement("dialog")}} containing the element has been displayed).</p>
+
+ <div class="note">
+ <p><strong>Note:</strong> An element with the <code>autofocus</code> attribute may gain focus before the {{domxref("DOMContentLoaded")}} event is fired.</p>
+ </div>
+
+ <p>No more than one element in the document may have the <code>autofocus</code> attribute, and <code>autofocus</code> cannot be used on inputs of type <code>hidden</code>, because hidden inputs can't be focused. If put on more than one element, the first one with the attribute receives focus .</p>
+
+ <div class="warning">
+ <p><strong>Warning:</strong> Automatically focusing a form control can confuse visually-impaired people using screen-reading technology and people with cognitive impairments. When <code>autofocus</code> is assigned, screen-readers "teleport" their user to the form control without warning them beforehand.</p>
+ </div>
+
+ <p>For better usability, avoid using <code>autofocus</code>. 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.</p>
+ </dd>
+ <dt id="htmlattrdefcapture">{{htmlattrdef("capture")}}</dt>
+ <dd>
+ <p>Introduced in the HTML Media Capture specification and valid for the <code>file</code> input type only, the <code>capture</code> attribute defines which media - microphone, video, or camera - should be used to capture a new file for upload with <code>file</code> upload control in supporting scenarios. See the {{HTMLElement("input/file", "file")}} input type.</p>
+ </dd>
+ <dt id="htmlattrdefchecked">{{htmlattrdef("checked")}}</dt>
+ <dd>
+ <p>Valid for both <code>radio</code> and <code>checkbox</code> types, <code>checked</code> 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 <code>checkbox</code> type, it indicates that the checkbox is checked by default (when the page loads). It does <em>not</em> indicate whether this checkbox is currently checked: if the checkbox’s state is changed, this content attribute does not reflect the change. (Only the <a href="/en-US/docs/Web/API/HTMLInputElement"><code>HTMLInputElement</code>’s <code>checked</code> IDL attribute</a> is updated.)</p>
+
+ <div class="note">
+ <p><strong>Note:</strong> Unlike other input controls, a checkboxes and radio buttons value are only included in the submitted data if they are currently <code>checked</code>. If they are, the name and the value(s) of the checked controls are submitted.</p>
+
+ <p>For example, if a checkbox whose <code>name</code> is <code>fruit</code> has a <code>value</code> of <code>cherry</code>, and the checkbox is checked, the form data submitted will include <code>fruit=cherry</code>. If the checkbox isn't active, it isn't listed in the form data at all. The default <code>value</code> for checkboxes and radio buttons is <code>on</code>.</p>
+ </div>
+ </dd>
+ <dt id="htmlattrdefdirname">{{htmlattrdef("dirname")}}</dt>
+ <dd>
+ <p>Valid for <code>text</code> and <code>search</code> input types only, the <code>dirname</code> 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 {{anch('name')}} and {{anch('value')}}, the second being the value of the <code>dirname</code> as the name with the value of <code>ltr</code> or <code>rtl</code> being set by the browser.</p>
+
+ <pre class="notranslate"><code class="html">&lt;form action="page.html" method="post"&gt;
+ &lt;label&gt;Fruit: &lt;input type="text" name="fruit" dirname="fruit.dir" value="cherry"&gt;&lt;/label&gt;
+ &lt;input type="submit"/&gt;
+&lt;/form&gt;
+&lt;!-- page.html?fruit=cherry&amp;fruit.dir=ltr --&gt;</code>
+</pre>
+
+ <p>When the form above is submitted, the input cause both the <code>name</code> / <code>value</code> pair of <code>fruit=cherry</code> and the <code>dirname</code> / direction pair of <code>fruit.dir=ltr</code> to be sent.</p>
+ </dd>
+ <dt id="htmlattrdefdisabled">{{htmlattrdef("disabled")}}</dt>
+ <dd>
+ <p>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.</p>
+
+ <p>Specifically, disabled inputs do not receive the {{event("click")}} event, and disabled inputs are not submitted with the form.</p>
+
+ <div class="note">
+ <p><strong>Note:</strong> Although not required by the specification, Firefox will by default <a href="https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing">persist the dynamic disabled state</a> of an <code>&lt;input&gt;</code> across page loads. Use the {{htmlattrxref("autocomplete","input")}} attribute to control this feature.</p>
+ </div>
+ </dd>
+ <dt id="htmlattrdefform">{{htmlattrdef("form")}}</dt>
+ <dd>
+ <p>A string specifying the {{HTMLElement("form")}} element with which the input is associated (that is, its <strong>form owner</strong>). This string's value, if present, must match the {{htmlattrxref("id")}} of a <code>&lt;form&gt;</code> element in the same document. If this attribute isn't specified, the <code>&lt;input&gt;</code> element is associated with the nearest containing form, if any.</p>
+
+ <p>The <code>form</code> attribute lets you place an input anywhere in the document but have it included with a form elsewhere in the document.</p>
+
+ <div class="note">
+ <p><strong>Note:</strong> An input can only be associated with one form.</p>
+ </div>
+ </dd>
+ <dt id="htmlattrdefformaction">{{htmlattrdef('formaction')}}</dt>
+ <dd>
+ <p>Valid for the <code>image</code> and <code>submit</code> input types only. See the {{HTMLElement("input/submit", "submit")}} input type for more information.</p>
+ </dd>
+ <dt id="htmlattrdefformenctype">{{htmlattrdef('formenctype')}}</dt>
+ <dd>
+ <p>Valid for the <code>image</code> and <code>submit</code> input types only. See the {{HTMLElement("input/submit", "submit")}} input type for more information.</p>
+ </dd>
+ <dt id="htmlattrdefformmethod">{{htmlattrdef('formmethod')}}</dt>
+ <dd>
+ <p>Valid for the <code>image</code> and <code>submit</code> input types only. See the {{HTMLElement("input/submit", "submit")}} input type for more information.</p>
+ </dd>
+ <dt id="htmlattrdefformnovalidate">{{htmlattrdef('formnovalidate')}}</dt>
+ <dd>
+ <p>Valid for the <code>image</code> and <code>submit</code> input types only. See the {{HTMLElement("input/submit", "submit")}} input type for more information.</p>
+ </dd>
+ <dt id="htmlattrdefformtarget">{{htmlattrdef('formtarget')}}</dt>
+ <dd>
+ <p>Valid for the <code>image</code> and <code>submit</code> input types only. See the {{HTMLElement("input/submit", "submit")}} input type for more information.</p>
+ </dd>
+ <dt id="htmlattrdefheight">{{htmlattrdef("height")}}</dt>
+ <dd>
+ <p>Valid for the <code>image</code> input button only, the <code>height</code> is the height of the image file to display to represent the graphical submit button. See the {{HTMLElement("input/image", "image")}} input type.</p>
+ </dd>
+ <dt id="htmlattrdefheight">{{htmlattrdef("id")}}</dt>
+ <dd>
+ <p>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 {{htmlelement('label')}}'s <code>for</code> attribute to link the label with the form control. See the {{anch('the label element')}} below.</p>
+ </dd>
+ <dt id="htmlattrdefheight">{{htmlattrdef("inputmode")}}</dt>
+ <dd>
+ <p>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<br>
+ <code>text</code>, <code>tel</code>, <code>url</code>, <code>email</code>, <code>numeric</code>, <code>decimal</code>, and <code>search</code></p>
+ </dd>
+ <dt id="htmlattrdeflist">{{htmlattrdef("list")}}</dt>
+ <dd id="datalist">
+ <p>The values of the list attribute is the {{domxref("Element.id", "id")}} of a {{HTMLElement("datalist")}} element located in the same document. The <code>&lt;datalist&gt;</code> 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 {{htmlattrxref("type", "input")}} 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.</p>
+
+ <pre class="brush: html hidden notranslate">&lt;datalist id="colorsxx"&gt;
+ &lt;option&gt;#ff0000&lt;/option&gt;
+ &lt;option&gt;#ee0000&lt;/option&gt;
+ &lt;option&gt;#dd0000&lt;/option&gt;
+ &lt;option&gt;#cc0000&lt;/option&gt;
+ &lt;option&gt;#bb0000&lt;/option&gt;
+&lt;/datalist&gt;
+&lt;datalist id="numbersxx"&gt;
+ &lt;option&gt;0&lt;/option&gt;
+ &lt;option&gt;2&lt;/option&gt;
+ &lt;option&gt;4&lt;/option&gt;
+ &lt;option&gt;8&lt;/option&gt;
+ &lt;option&gt;16&lt;/option&gt;
+ &lt;option&gt;32&lt;/option&gt;
+ &lt;option&gt;64&lt;/option&gt;
+&lt;/datalist&gt;
+&lt;datalist id="fruitsxx"&gt;
+ &lt;option&gt;cherry&lt;/option&gt;
+ &lt;option&gt;banana&lt;/option&gt;
+ &lt;option&gt;mango&lt;/option&gt;
+ &lt;option&gt;orange&lt;/option&gt;
+ &lt;option&gt;blueberry&lt;/option&gt;
+&lt;/datalist&gt;
+&lt;datalist id="urlsxx"&gt;
+ &lt;option&gt;https://developer.mozilla.org&lt;/option&gt;
+ &lt;option&gt;https://caniuse.com/&lt;/option&gt;
+ &lt;option&gt;https://mozilla.com&lt;/option&gt;
+ &lt;option&gt;https://mdn.github.io&lt;/option&gt;
+ &lt;option&gt;https://www.youtube.com/user/firefoxchannel&lt;/option&gt;
+&lt;/datalist&gt;
+
+&lt;p&gt;&lt;label for="textx"&gt;Text&lt;/label&gt; &lt;input type="text" list="fruitsxx" id="textx"/&gt;&lt;/p&gt;
+&lt;p&gt;&lt;label for="colorx"&gt;Color&lt;/label&gt; &lt;input type="color" list="colorsxx" id="colorx"/&gt;&lt;/p&gt;
+&lt;p&gt;&lt;label for="rangex"&gt;Range&lt;/label&gt; &lt;input type="range" min="0" max="64" list="numbersxx" id="rangex"/&gt;&lt;/p&gt;
+&lt;p&gt;&lt;label for="numberx"&gt;Number&lt;/label&gt; &lt;input type="number" min="0" max="64" list="numbersxx" id="numberx"/&gt;&lt;/p&gt;
+&lt;p&gt;&lt;label for="urlx"&gt;URL&lt;/label&gt; &lt;input type="url" list="urlsxx" id="urlx"/&gt;&lt;/p&gt;</pre>
+
+ <p>{{EmbedLiveSample("datalist",400,275,"","", "nobutton")}}</p>
+
+ <p>It is valid on <code>text</code>, <code>search</code>, <code>url</code>, <code>tel</code>, <code>email</code>, <code>date</code>, <code>month</code>, <code>week</code>, <code>time</code>, <code>datetime-local</code>, <code>number</code>, <code>range</code>, and <code>color.</code>Per the specifications, the <code>list</code> attribute is not supported by the <code>hidden</code>, <code>password</code>, <code>checkbox</code>, <code>radio</code>, <code>file</code>, or any of the button types.</p>
+
+ <p>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 <a href="/en-US/docs/Web/HTML/Element/datalist#Browser_compatibility">browser compatibility table</a> for the other input types.</p>
+
+ <p>See the {{htmlelement('datalist')}} element.</p>
+ </dd>
+ <dt id="htmlattrdefmax"><a href="/en-US/docs/Web/HTML/Attributes/max">{{htmlattrdef("max")}}</a></dt>
+ <dd>
+ <p>Valid for <code>date</code>, <code>month</code>, <code>week</code>, <code>time</code>, <code>datetime-local</code>, <code>number</code>, and <code>range</code>, it defines the greatest value in the range of permitted values. If the {{htmlattrxref("value", "input")}} entered into the element exceeds this, the element fails <a href="/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation">constraint validation</a>. If the value of the <code>max</code> attribute isn't a number, then the element has no maximum value.</p>
+ </dd>
+ <dt id="htmlattrdefmaxlength">{{htmlattrdef("maxlength")}}</dt>
+ <dd>
+ <p>Valid for <code>text</code>, <code>search</code>, <code>url</code>, <code>tel</code>, <code>email</code>, and <code>password</code>, 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 <code>maxlength</code> 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 <code>minlength</code>.</p>
+
+ <p>The input will fail <a href="/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation">constraint validation</a> if the length of the text entered into the field is greater than <code>maxlength</code> UTF-16 code units long. By default, browsers prevent users from entering more characters than allowed by the <code>maxlength</code> attribute. See {{anch("Client-side validation")}} for more information.</p>
+ </dd>
+ <dt id="htmlattrdefmin">{{htmlattrdef("min")}}</dt>
+ <dd>
+ <p>Valid for <code>date</code>, <code>month</code>, <code>week</code>, <code>time</code>, <code>datetime-local</code>, <code>number</code>, and <code>range</code>, it defines the most negative value in the range of permitted values. If the {{htmlattrxref("value", "input")}} entered into the element is less than this this, the element fails <a href="/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation">constraint validation</a>. If the value of the <code>min</code> attribute isn't a number, then the element has no minimum value.</p>
+
+ <p>This value must be less than or equal to the value of the <code>max</code> attribute. If the <code>min</code> attribute is present by is not specified or is invalid, no <code>min</code> value is applied. If the <code>min</code> attribute is valid and a non-empty value is less than the minimum allowed by the <code>min</code> attribute, constraint validation will prevent form submission. See {{anch("Client-side validation")}} for more information.</p>
+ </dd>
+ <dt id="htmlattrdefminlength">{{htmlattrdef("minlength")}}</dt>
+ <dd>
+ <p>Valid for <code>text</code>, <code>search</code>, <code>url</code>, <code>tel</code>, <code>email</code>, and <code>password</code>, 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 <code>maxlength</code>. If no <code>minlength</code> is specified, or an invalid value is specified, the input has no minimum length.</p>
+
+ <p>The input will fail <a href="/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation">constraint validation</a> if the length of the text entered into the field is fewer than <code>minlength</code> UTF-16 code units long, preventing form submission. See {{anch("Client-side validation")}} for more information.</p>
+ </dd>
+ <dt id="htmlattrdefmultiple">{{htmlattrdef("multiple")}}</dt>
+ <dd>
+ <p>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 <code>file</code> input. See the {{HTMLElement("input/email", "email")}} and {{HTMLElement("input/file", "file")}} input type.</p>
+ </dd>
+ <dt id="htmlattrdefname">{{htmlattrdef("name")}}</dt>
+ <dd>
+ <p>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.</p>
+
+ <h5 id="Whats_in_a_name">What's in a name</h5>
+
+ <p>Consider the <code>name</code> a required attribute (even though it's not). If an input has no <code>name</code> specified, or <code>name</code> 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.)</p>
+
+ <p>There are two special cases:</p>
+
+ <ol>
+ <li><code>_charset_</code> : If used as the name of an <code>&lt;input&gt;</code> element of type <code><a href="/en-US/docs/Web/HTML/Element/input/hidden">hidden</a></code>, the input's <code>value</code> is automatically set by the <a class="glossaryLink" href="/en-US/docs/Glossary/user_agent" title="user agent: A user agent is a computer program representing a person, for example, a browser in a Web context.">user agent</a> to the character encoding being used to submit the form.</li>
+ <li><code>isindex</code>: For historical reasons, the name <code><a href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-name">isindex</a></code> is not allowed.</li>
+ </ol>
+
+ <h5 id="name_and_radio_buttons"><code>name</code> and radio buttons</h5>
+
+ <p>The {{anch('name')}} attribute creates a unique behavior for radio buttons.</p>
+
+ <p>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,</p>
+
+ <p>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.</p>
+
+ <p>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.</p>
+
+ <h5 id="domxrefHTMLFormElement.elements">{{domxref("HTMLFormElement.elements")}}</h5>
+
+ <p>When an input element is given a <code>name</code>, that name becomes a property of the owning form element's {{domxref("HTMLFormElement.elements")}} property. If you have an input whose <code>name</code> is set to <code>guest</code> and another whose <code>name</code> is <code>hat-size</code>, the following code can be used:</p>
+
+ <pre class="brush: js notranslate">let form = document.querySelector("form");
+
+let guestName = form.elements.guest;
+let hatSize = form.elements["hat-size"];
+</pre>
+
+ <p>When this code has run, <code>guestName</code> will be the {{domxref("HTMLInputElement")}} for the <code>guest</code> field, and <code>hatSize</code> the object for the <code>hat-size</code> field.</p>
+
+ <div class="warning">
+ <p><strong>Warning:</strong> You should avoid giving form elements a <code>name</code> 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.</p>
+ </div>
+ </dd>
+ <dt id="htmlattrdefpattern">{{htmlattrdef("pattern")}}</dt>
+ <dd>
+ <div id="pattern-include">
+ <p>The <code>pattern</code> attribute, when specified, is a regular expression that the input's {{htmlattrxref("value")}} must match in order for the value to pass <a href="/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation">constraint validation</a>. It must be a valid JavaScript regular expression, as used by the {{jsxref("RegExp")}} type, and as documented in our <a href="/en-US/docs/Web/JavaScript/Guide/Regular_Expressions">guide on regular expressions</a>; the <code>'u'</code> 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.</p>
+
+ <p>If the <code>pattern</code> 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.</p>
+
+ <div class="note">
+ <p><strong>Tip:</strong> If using the <code>pattern</code> attribute, inform the user about the expected format by including explanatory text nearby. You can also include a {{htmlattrxref("title", "input")}} 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.</p>
+ </div>
+ </div>
+
+ <p>See {{anch("Client-side validation")}} for more information.</p>
+ </dd>
+ <dt id="htmlattrdefplaceholder">{{htmlattrdef("placeholder")}}</dt>
+ <dd>
+ <p>The <code>placeholder</code> 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 <em>must not</em> include carriage returns or line feeds.</p>
+
+ <div class="note">
+ <p><strong>Note:</strong> The <code>placeholder</code> attribute is not as semantically useful as other ways to explain your form, and can cause unexpected technical issues with your content. See {{SectionOnPage("/en-US/docs/Web/HTML/Element/input", "Labels and placeholders")}} for more information.</p>
+ </div>
+ </dd>
+ <dt id="htmlattrdefreadonly">{{htmlattrdef("readonly")}}</dt>
+ <dd>
+ <p>A Boolean attribute which, if present, indicates that the user should not be able to edit the value of the input. The <code>readonly</code> attribute is supported <code>text</code>, <code>search</code>, <code>url</code>, <code>tel</code>, <code>email</code>, <code>date</code>, <code>month</code>, <code>week</code>, <code>time</code>, <code>datetime-local</code>, <code>number</code>, and <code>password</code> input types.</p>
+
+ <p>See the <a href="/en-US/docs/Web/HTML/Attributes/readonly">HTML attribute: <code>readonly</code></a> for more information.</p>
+ </dd>
+ <dt id="htmlattrdefrequired">{{htmlattrdef("required")}}</dt>
+ <dd>
+ <p><code>required</code> 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 <code>required</code> attribute is supported <code>text</code>, <code>search</code>, <code>url</code>, <code>tel</code>, <code>email</code>, <code>date</code>, <code>month</code>, <code>week</code>, <code>time</code>, <code>datetime-local</code>, <code>number</code>, <code>password</code>, <code>checkbox</code>, <code>radio</code>, and <code>file</code>.</p>
+
+ <p>See {{anch("Client-side validation")}} and the <a href="/en-US/docs/Web/HTML/Attributes/required">HTML attribute: <code>required</code></a> for more information.</p>
+ </dd>
+ <dt id="htmlattrdefsize">{{htmlattrdef("size")}}</dt>
+ <dd>Valid for <code>email</code>, <code>password</code>, <code>tel</code>, and text <code>input</code> types only. Specifies how much of the input is shown. Basically creates same result as setting CSS <code>width</code> 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 <code>em</code> units) and <code>pixel</code>s for others. CSS width takes precedence over size attribute.</dd>
+ <dt id="htmlattrdefsrc">{{htmlattrdef("src")}}</dt>
+ <dd>
+ <p>Valid for the <code>image</code> input button only, the <code>src</code> is string specifying the URL of the image file to display to represent the graphical submit button. See the {{HTMLElement("input/image", "image")}} input type.</p>
+ </dd>
+ <dt id="htmlattrdefstep">{{htmlattrdef("step")}}</dt>
+ <dd>
+ <div id="step-include">
+ <p>Valid for the numeric input types, including <code>number</code>, date/time input types, and <code>range</code>, the <code><a href="/en-US/docs/Web/HTML/Attributes/step">step</a></code> attribute is a number that specifies the granularity that the value must adhere to.</p>
+
+ <p>If not explicitly included, <code>step</code> defaults to 1 for <code>number</code> and <code>range</code>, 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 <code>any</code>, which means no stepping is implied, and any value is allowed (barring other constraints, such as <code>{{anch("min")}}</code> and <code>{{anch("max")}}</code>).</p>
+
+ <p>If <code>any</code> is not explicity set, valid values for the <code>number</code>, date/time input types, and <code>range</code> input types are equal to the basis for stepping - the <code>{{anch("min")}}</code> value and increments of the step value, up to the <code>{{anch("max")}}</code> value, if specified. For example, if we have <code>&lt;input type="number" min="10" step="2"&gt;</code> any even integer, 10 or great, is valid. If omitted, <code>&lt;input type="number"&gt;</code>, any integer is valid, but floats, like 4.2, are not valid, as <code>step</code> defaults to 1. For 4.2 to be valid, <code>step</code> would have had to be set to <code>any</code>, 0.1, 0.2, or any the min value would have had to be a number ending in .2, such as <code>&lt;input type="number" min="-5.2"&gt;</code></p>
+
+ <div class="note">
+ <p><strong>Note:</strong> 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</p>
+ </div>
+ </div>
+
+ <p>The default stepping value for <code>number</code> inputs is 1, allowing only integers to be entered, <em>unless</em> the stepping base is not an integer. The default stepping value for <code>time</code> is 1 second, with 900 being equal to 15 minutes.</p>
+
+ <p>See {{anch("Client-side validation")}} for more information.</p>
+ </dd>
+ <dt id="htmlattrdeftype">{{htmlattrdef("tabindex")}}</dt>
+ <dd>
+ <p>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.</p>
+ </dd>
+ <dt id="htmlattrdefformenctype">{{htmlattrdef('title')}}</dt>
+ <dd>
+ <p>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 {{htmlelement('label')}} element with a <code>for</code> attribute set to the form control's {{htmlattrdef('id')}} attribute. See {{anch("Labels")}} below.</p>
+ </dd>
+ <dt id="htmlattrdeftype">{{htmlattrdef("type")}}</dt>
+ <dd>
+ <p>A string specifying the type of control to render. For example, to create a checkbox, a value of <code>checkbox</code> is used. If omitted (or an unknown value is specified), the input type <code>text</code> is used, creating a plaintext input field.</p>
+
+ <p>Permitted values are listed in {{anch("&lt;input&gt; types")}} above.</p>
+ </dd>
+ <dt id="htmlattrdefvalue">{{htmlattrdef("value")}}</dt>
+ <dd>
+ <p>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 {{domxref("HTMLInputElement")}} object's <code>value</code> property. The <code>value</code> attribute is always optional, though should be considered mandatory for <code>checkbox</code>, <code>radio</code>, and <code>hidden</code>.</p>
+ </dd>
+ <dt id="htmlattrdefwidth">{{htmlattrdef("width")}}</dt>
+ <dd>
+ <p>Valid for the <code>image</code> input button only, the <code>width</code> is the width of the image file to display to represent the graphical submit button. See the {{HTMLElement("input/image", "image")}} input type.</p>
+ </dd>
+</dl>
+
+<h3 id="Non-standard_attributes">Non-standard attributes</h3>
+
+<p>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.</p>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Attribute</th>
+ <th scope="col">Description</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td><code>{{anch("autocorrect")}}</code></td>
+ <td>A string indicating whether or not autocorrect is <code>on</code> or <code>off</code>. <strong>Safari only.</strong></td>
+ </tr>
+ <tr>
+ <td><code>{{anch("incremental")}}</code></td>
+ <td>Whether or not to send repeated {{event("search")}} events to allow updating live search results while the user is still editing the value of the field. <strong>WebKit and Blink only (Safari, Chrome, Opera, etc.).</strong></td>
+ </tr>
+ <tr>
+ <td><code>{{anch("mozactionhint")}}</code></td>
+ <td>A string indicating the type of action that will be taken when the user presses the <kbd>Enter</kbd> or <kbd>Return</kbd> key while editing the field; this is used to determine an appropriate label for that key on a virtual keyboard. <strong>Firefox for Android only.</strong></td>
+ </tr>
+ <tr>
+ <td><code>{{anch("orient")}}</code></td>
+ <td>Sets the orientation of the range slider. <strong>Firefox only.</strong></td>
+ </tr>
+ <tr>
+ <td><code>{{anch("results")}}</code></td>
+ <td>The maximum number of items that should be displayed in the drop-down list of previous search queries. <strong>Safari only.</strong></td>
+ </tr>
+ <tr>
+ <td><code>{{anch("webkitdirectory")}}</code></td>
+ <td>A Boolean indicating whether or not to only allow the user to choose a directory (or directories, if <code>{{anch("multiple")}}</code> is also present)</td>
+ </tr>
+ </tbody>
+</table>
+
+<dl>
+ <dt>{{htmlattrdef("autocorrect")}} {{non-standard_inline}}</dt>
+ <dd>{{page("/en-US/docs/Web/HTML/Element/input/text", "autocorrect-include")}}</dd>
+ <dt>{{htmlattrdef("incremental")}} {{non-standard_inline}}</dt>
+ <dd>{{page("/en-US/docs/Web/HTML/Element/input/search", "incremental-include")}}</dd>
+ <dt>{{htmlattrdef("mozactionhint")}} {{non-standard_inline}}</dt>
+ <dd>{{page("/en-US/docs/Web/HTML/Element/input/text", "mozactionhint-include")}}</dd>
+ <dt>{{htmlattrdef("orient")}} {{non-standard_inline}}</dt>
+ <dd>{{page("/en-US/docs/Web/HTML/Element/input/range", "orient-include")}}</dd>
+ <dt>{{htmlattrdef("results")}} {{non-standard_inline}}</dt>
+ <dd>{{page("/en-US/docs/Web/HTML/Element/input/search", "results-include")}}</dd>
+ <dt>{{htmlattrdef("webkitdirectory")}} {{non-standard_inline}}</dt>
+ <dd>{{page("/en-US/docs/Web/HTML/Element/input/file", "webkitdirectory-include")}}</dd>
+</dl>
+
+<h2 id="예제">예제</h2>
+
+<h3 id="A_simple_input_box">A simple input box</h3>
+
+<pre class="brush: html notranslate">&lt;!-- A basic input --&gt;
+&lt;input type="text" name="input" value="Type here"&gt;
+</pre>
+
+<p><input></p>
+
+<h3 id="A_common_use-case_scenario">A common use-case scenario</h3>
+
+<pre class="brush: html notranslate">&lt;!-- A common form that includes input tags --&gt;
+&lt;form action="getform.php" method="get"&gt;
+ &lt;label&gt;First name: &lt;input type="text" name="first_name" /&gt;&lt;/label&gt;&lt;br /&gt;
+ &lt;label&gt;Last name: &lt;input type="text" name="last_name" /&gt;&lt;/label&gt;&lt;br /&gt;
+ &lt;label&gt;E-mail: &lt;input type="email" name="user_email" /&gt;&lt;/label&gt;&lt;br /&gt;
+ &lt;input type="submit" value="Submit" /&gt;
+&lt;/form&gt;
+</pre>
+
+<h2 id="Specifications" name="Specifications">명세</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">명세</th>
+ <th scope="col">상태</th>
+ <th scope="col">주석</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', 'the-input-element.html#the-input-element', '&lt;input&gt;')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', 'forms.html#the-input-element', '&lt;input&gt;')}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML4.01', 'interact/forms.html#h-17.4', '&lt;form&gt;')}}</td>
+ <td>{{Spec2('HTML4.01')}}</td>
+ <td></td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="브라우저_호환성">브라우저 호환성</h2>
+
+<p>{{Compat("html.elements.input")}}</p>