Annotation of html5/spec/common-input-element-attributes.html, revision 1.21

1.1       mike        1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
                      2: <!DOCTYPE html>
                      3: <!-- when publishing, change bits marked ZZZ --><html lang="en-US-x-Hixie" class="split chapter"><head><title>4.10.7.2 Common input element attributes &#8212; HTML5 </title><style type="text/css">
                      4:    pre { margin-left: 2em; white-space: pre-wrap; }
                      5:    h2 { margin: 3em 0 1em 0; }
                      6:    h3 { margin: 2.5em 0 1em 0; }
                      7:    h4 { margin: 2.5em 0 0.75em 0; }
                      8:    h5, h6 { margin: 2.5em 0 1em; }
                      9:    h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
                     10:    h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
                     11:    p { margin: 1em 0; }
                     12:    hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
                     13:    dl, dd { margin-top: 0; margin-bottom: 0; }
                     14:    dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
                     15:    dt + dt { margin-top: 0; }
                     16:    dd dt { margin-top: 0.25em; margin-bottom: 0; }
                     17:    dd p { margin-top: 0; }
                     18:    dd dl + p { margin-top: 1em; }
                     19:    dd table + p { margin-top: 1em; }
                     20:    p + * > li, dd li { margin: 1em 0; }
                     21:    dt, dfn { font-weight: bold; font-style: normal; }
                     22:    dt dfn { font-style: italic; }
                     23:    pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
                     24:    pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
                     25:    pre em { font-weight: bolder; font-style: normal; }
                     26:    @media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
                     27:    var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
                     28:    table { border-collapse: collapse; border-style: hidden hidden none hidden; }
                     29:    table thead, table tbody { border-bottom: solid; }
                     30:    table tbody th:first-child { border-left: solid; }
                     31:    table tbody th { text-align: left; }
                     32:    table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
                     33:    blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }
                     34: 
                     35:    .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
                     36:    .matrix, .matrix td { border: none; text-align: right; }
                     37:    .matrix { margin-left: 2em; }
                     38:    .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
                     39:    .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
                     40:    .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
                     41: 
                     42:    .toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
                     43:    img.extra { float: right; }
                     44:    pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; }
                     45:    pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
                     46:    pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
                     47:    pre.css:first-line { color: #AAAA50; }
                     48:    dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
                     49:    hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
                     50:    dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
                     51:    dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
                     52:    dl.domintro dd p { margin: 0.5em 0; }
                     53:    dl.switch { padding-left: 2em; }
                     54:    dl.switch > dt { text-indent: -1.5em; }
                     55:    dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
                     56:    dl.triple { padding: 0 0 0 1em; }
                     57:    dl.triple dt, dl.triple dd { margin: 0; display: inline }
                     58:    dl.triple dt:after { content: ':'; }
                     59:    dl.triple dd:after { content: '\A'; white-space: pre; }
                     60:    .diff-old { text-decoration: line-through; color: silver; background: transparent; }
                     61:    .diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
                     62:    a .diff-new { border-bottom: 1px blue solid; }
                     63: 
                     64:    h2 { page-break-before: always; }
                     65:    h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
                     66:    h1 + h2, hr + h2.no-toc { page-break-before: auto; }
                     67: 
1.20      mike       68:    p  > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]),
                     69:    li > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]), { border-bottom: solid #9999CC; }
1.1       mike       70: 
                     71:    div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
                     72:    div.head p { margin: 0; }
                     73:    div.head h1 { margin: 0; }
                     74:    div.head .logo { float: right; margin: 0 1em; }
                     75:    div.head .logo img { border: none } /* remove border from top image */
                     76:    div.head dl { margin: 1em 0; }
                     77:    div.head p.copyright, div.head p.alt { font-size: x-small; font-style: oblique; margin: 0; }
                     78: 
                     79:    body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
                     80:    body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
                     81:    body > .toc > li > * { margin-bottom: 0.5em; }
                     82:    body > .toc > li > * > li > * { margin-bottom: 0.25em; }
                     83:    .toc, .toc li { list-style: none; }
                     84: 
                     85:    .brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
                     86:    .brief li { margin: 0; padding: 0; }
                     87:    .brief li p { margin: 0; padding: 0; }
                     88: 
                     89:    .category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
                     90:    .category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
                     91:    .category-list li { display: inline; }
                     92:    .category-list li:not(:last-child)::after { content: ', '; }
                     93:    .category-list li > span, .category-list li > a { text-transform: lowercase; }
                     94:    .category-list li * { text-transform: none; } /* don't affect <code> nested in <a> */
                     95: 
                     96:    .XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
                     97:    .XXX > :first-child { margin-top: 0; }
                     98:    p .XXX { line-height: 3em; }
                     99:    .annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
                    100:    .annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
                    101:    .annotation :link, .annotation :visited { color: inherit; }
                    102:    .annotation :link:hover, .annotation :visited:hover { background: transparent; }
                    103:    .annotation span { border: none ! important; }
                    104:    .note { color: green; background: transparent; font-family: sans-serif; }
                    105:    .warning { color: red; background: transparent; }
                    106:    .note, .warning { font-weight: bolder; font-style: italic; }
                    107:    p.note, div.note { padding: 0.5em 2em; }
                    108:    span.note { padding: 0 2em; }
                    109:    .note p:first-child, .warning p:first-child { margin-top: 0; }
                    110:    .note p:last-child, .warning p:last-child { margin-bottom: 0; }
                    111:    .warning:before { font-style: normal; }
                    112:    p.note:before { content: 'Note: '; }
                    113:    p.warning:before { content: '\26A0 Warning! '; }
                    114: 
                    115:    .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
                    116:    .bookkeeping { font-size: 0.8em; margin: 2em 0; }
                    117:    .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }
1.10      mike      118:    .bookkeeping dt { margin: 0.5em 2em 0; }
                    119:    .bookkeeping dd { margin: 0 3em 0.5em; }
1.1       mike      120: 
                    121:    h4 { position: relative; z-index: 3; }
                    122:    h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
                    123:    .element {
                    124:      background: #EEEEFF;
                    125:      color: black;
                    126:      margin: 0 0 1em 0.15em;
                    127:      padding: 0 1em 0.25em 0.75em;
                    128:      border-left: solid #9999FF 0.25em;
                    129:      position: relative;
                    130:      z-index: 1;
                    131:    }
                    132:    .element:before {
                    133:      position: absolute;
                    134:      z-index: 2;
                    135:      top: 0;
                    136:      left: -1.15em;
                    137:      height: 2em;
                    138:      width: 0.9em;
                    139:      background: #EEEEFF;
                    140:      content: ' ';
                    141:      border-style: none none solid solid;
                    142:      border-color: #9999FF;
                    143:      border-width: 0.25em;
                    144:    }
                    145: 
                    146:    .example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; }
                    147:    td > .example:only-child { margin: 0 0 0 0.1em; }
                    148: 
                    149:    ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
                    150:    ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
                    151:    ul.domTree li li { list-style: none; }
                    152:    ul.domTree li:first-child::before { position: absolute; top: 0; height: 0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
                    153:    ul.domTree li:not(:last-child)::after { position: absolute; top: 0; bottom: -0.6em; left: -0.75em; width: 0.5em; border-style: none none solid solid; content: ''; border-width: 0.1em; }
                    154:    ul.domTree span { font-style: italic; font-family: serif; }
                    155:    ul.domTree .t1 code { color: purple; font-weight: bold; }
                    156:    ul.domTree .t2 { font-style: normal; font-family: monospace; }
                    157:    ul.domTree .t2 .name { color: black; font-weight: bold; }
                    158:    ul.domTree .t2 .value { color: blue; font-weight: normal; }
                    159:    ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
                    160:    ul.domTree .t7 code, .domTree .t8 code { color: green; }
                    161:    ul.domTree .t10 code { color: teal; }
                    162: 
                    163:    body.dfnEnabled dfn { cursor: pointer; }
                    164:    .dfnPanel {
                    165:      display: inline;
                    166:      position: absolute;
                    167:      z-index: 10;
                    168:      height: auto;
                    169:      width: auto;
                    170:      padding: 0.5em 0.75em;
                    171:      font: small sans-serif, Droid Sans Fallback;
                    172:      background: #DDDDDD;
                    173:      color: black;
                    174:      border: outset 0.2em;
                    175:    }
                    176:    .dfnPanel * { margin: 0; padding: 0; font: inherit; text-indent: 0; }
                    177:    .dfnPanel :link, .dfnPanel :visited { color: black; }
                    178:    .dfnPanel p { font-weight: bolder; }
                    179:    .dfnPanel * + p { margin-top: 0.25em; }
                    180:    .dfnPanel li { list-style-position: inside; }
                    181: 
                    182:    #configUI { position: absolute; z-index: 20; top: 10em; right: 1em; width: 11em; font-size: small; }
                    183:    #configUI p { margin: 0.5em 0; padding: 0.3em; background: #EEEEEE; color: black; border: inset thin; }
                    184:    #configUI p label { display: block; }
                    185:    #configUI #updateUI, #configUI .loginUI { text-align: center; }
                    186:    #configUI input[type=button] { display: block; margin: auto; }
1.8       mike      187: 
1.19      mike      188:    fieldset { margin: 1em; }
                    189:    fieldset > legend * + { margin-top: 0; }
                    190:    fieldset > :last-child { margin-bottom: 0; }
                    191: 
1.1       mike      192:   </style><style type="text/css">
                    193: 
                    194:    .applies thead th > * { display: block; }
                    195:    .applies thead code { display: block; }
                    196:    .applies tbody th { whitespace: nowrap; }
                    197:    .applies td { text-align: center; }
                    198:    .applies .yes { background: yellow; }
                    199: 
1.11      mike      200:    .matrix, .matrix td { border: hidden; text-align: right; }
1.1       mike      201:    .matrix { margin-left: 2em; }
                    202: 
                    203:    .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
                    204:    .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
                    205:    .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
                    206: 
1.16      mike      207:    td.eg { border-width: thin; text-align: center; }
                    208: 
1.1       mike      209:    #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
                    210:    #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
                    211:    #table-example-1 caption { padding-bottom: 0.5em; }
                    212:    #table-example-1 thead, #table-example-1 tbody { border: none; }
                    213:    #table-example-1 th, #table-example-1 td { border: solid thin; }
                    214:    #table-example-1 th { font-weight: normal; }
                    215:    #table-example-1 td { border-style: none solid; vertical-align: top; }
                    216:    #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
                    217:    #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
                    218:    #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
                    219:    #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
                    220:    #table-example-1 tbody td:first-child::after { content: leader(". "); }
                    221:    #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
                    222:    #table-example-1 tbody td:first-child + td { width: 10em; }
                    223:    #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
                    224:    #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
                    225: 
                    226:    .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
                    227:    .apple-table-examples * { font-family: "Times", serif; }
                    228:    .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
                    229:    .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
                    230:    .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
                    231:    .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
                    232:    .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
                    233:    .apple-table-examples td { text-align: right; vertical-align: top; }
                    234:    .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
                    235:    .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
                    236:    .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
                    237:    .apple-table-examples sup { line-height: 0; }
                    238: 
                    239:    .details-example img { vertical-align: top; }
                    240: 
                    241:    #named-character-references-table {
1.18      mike      242:      white-space: nowrap;
1.1       mike      243:      font-size: 0.6em;
1.18      mike      244:      column-width: 30em;
1.1       mike      245:      column-gap: 1em;
1.18      mike      246:      -moz-column-width: 30em;
1.1       mike      247:      -moz-column-gap: 1em;
1.18      mike      248:      -webkit-column-width: 30em;
1.1       mike      249:      -webkit-column-gap: 1em;
                    250:    }
1.18      mike      251:    #named-character-references-table > table > tbody > tr > td:first-child + td,
1.1       mike      252:    #named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
                    253:    #named-character-references-table > table > tbody > tr > td:last-child:hover > span { position: absolute; top: auto; left: auto; margin-left: 0.5em; line-height: 1.2; font-size: 5em; border: outset; padding: 0.25em 0.5em; background: white; width: 1.25em; height: auto; text-align: center; }
1.18      mike      254:    #named-character-references-table > table > tbody > tr#entity-CounterClockwiseContourIntegral > td:first-child { font-size: 0.5em; }
1.1       mike      255: 
1.2       mike      256:    .glyph.control { color: red; }
                    257: 
1.4       mike      258:    @font-face {
                    259:      font-family: 'Essays1743';
                    260:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743.ttf');
                    261:    }
                    262:    @font-face {
                    263:      font-family: 'Essays1743';
                    264:      font-weight: bold;
                    265:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Bold.ttf');
                    266:    }
                    267:    @font-face {
                    268:      font-family: 'Essays1743';
                    269:      font-style: italic;
                    270:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Italic.ttf');
                    271:    }
                    272:    @font-face {
                    273:      font-family: 'Essays1743';
                    274:      font-style: italic;
                    275:      font-weight: bold;
                    276:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-BoldItalic.ttf');
                    277:    }
                    278: 
1.1       mike      279:   </style><style type="text/css">
                    280:    .domintro:before { display: table; margin: -1em -0.5em -0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: black; font-style: italic; border: solid 2px; background: white; padding: 0 0.25em; }
                    281:   </style><link href="data:text/css," id="complete" rel="stylesheet" title="Complete specification"><link href="data:text/css,.impl%20%7B%20display:%20none;%20%7D%0Ahtml%20%7B%20border:%20solid%20yellow;%20%7D%20.domintro:before%20%7B%20display:%20none;%20%7D" id="author" rel="alternate stylesheet" title="Author documentation only"><link href="data:text/css,.impl%20%7B%20background:%20%23FFEEEE;%20%7D%20.domintro:before%20%7B%20background:%20%23FFEEEE;%20%7D" id="highlight" rel="alternate stylesheet" title="Highlight implementation requirements"><script type="text/javascript">
                    282:    function getCookie(name) {
                    283:      var params = location.search.substr(1).split("&");
                    284:      for (var index = 0; index < params.length; index++) {
                    285:        if (params[index] == name)
                    286:          return "1";
                    287:        var data = params[index].split("=");
                    288:        if (data[0] == name)
                    289:          return unescape(data[1]);
                    290:      }
                    291:      var cookies = document.cookie.split("; ");
                    292:      for (var index = 0; index < cookies.length; index++) {
                    293:        var data = cookies[index].split("=");
                    294:        if (data[0] == name)
                    295:          return unescape(data[1]);
                    296:      }
                    297:      return null;
                    298:    }
                    299:    function load(script) {
                    300:      var e = document.createElement('script');
1.21    ! mike      301:      e.setAttribute('src', 'http://www.whatwg.org/specs/web-apps/current-work/' + script + '?' + encodeURIComponent(location) + '&' + encodeURIComponent(document.referrer));
1.1       mike      302:      document.body.appendChild(e);
                    303:    }
                    304:    function init() {
                    305:      if (location.search == '?slow-browser')
                    306:        return;
                    307:      var configUI = document.createElement('div');
                    308:      configUI.id = 'configUI';
                    309:      document.body.appendChild(configUI);
                    310:      // load('reviewer.js'); // would need cross-site XHR
                    311:      if (document.getElementById('head'))
                    312:        load('toc.js');
                    313:      load('styler.js');
                    314:      // load('updater.js'); // would need cross-site XHR
                    315:      load('dfn.js'); // doesn't support split-out specs, but, oh well.
                    316:      // load('status.js'); // would need cross-site XHR
                    317:      if (getCookie('profile') == '1')
                    318:        document.getElementsByTagName('h2')[0].textContent += '; load: ' + (new Date() - loadTimer) + 'ms';
                    319:      fixBrokenLink();
                    320:    }
1.21    ! mike      321:   </script><link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet" type="text/css">
1.1       mike      322:   <script src="link-fixup.js"></script>
                    323:   <link href="number-state.html" title="4.10.7.1.13 Number state" rel="prev">
                    324:   <link href="spec.html#contents" title="Table of contents" rel="index">
                    325:   <link href="the-button-element.html" title="4.10.8 The button element" rel="next">
                    326:   </head><body onload="fixBrokenLink(); init()"><div class="head" id="head">
                    327:    <p><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
1.3       mike      328: 
1.1       mike      329:    <h1>HTML5</h1>
                    330:    </div><div>
                    331:    <a href="number-state.html">&#8592; 4.10.7.1.13 Number state</a> &#8211;
                    332:    <a href="spec.html#contents">Table of contents</a> &#8211;
                    333:    <a href="the-button-element.html">4.10.8 The button element &#8594;</a>
                    334:   <ol class="toc"><li><ol><li><ol><li><ol><li><a href="common-input-element-attributes.html#common-input-element-attributes"><span class="secno">4.10.7.2 </span>Common <code>input</code> element attributes</a>
                    335:         <ol><li><a href="common-input-element-attributes.html#the-autocomplete-attribute"><span class="secno">4.10.7.2.1 </span>The <code title="attr-input-autocomplete">autocomplete</code> attribute</a></li><li><a href="common-input-element-attributes.html#the-list-attribute"><span class="secno">4.10.7.2.2 </span>The <code title="attr-input-list">list</code> attribute</a></li><li><a href="common-input-element-attributes.html#the-readonly-attribute"><span class="secno">4.10.7.2.3 </span>The <code title="attr-input-readonly">readonly</code> attribute</a></li><li><a href="common-input-element-attributes.html#the-size-attribute"><span class="secno">4.10.7.2.4 </span>The <code title="attr-input-size">size</code> attribute</a></li><li><a href="common-input-element-attributes.html#the-required-attribute"><span class="secno">4.10.7.2.5 </span>The <code title="attr-input-required">required</code> attribute</a></li><li><a href="common-input-element-attributes.html#the-multiple-attribute"><span class="secno">4.10.7.2.6 </span>The <code title="attr-input-multiple">multiple</code> attribute</a></li><li><a href="common-input-element-attributes.html#the-maxlength-attribute"><span class="secno">4.10.7.2.7 </span>The <code title="attr-input-maxlength">maxlength</code> attribute</a></li><li><a href="common-input-element-attributes.html#the-pattern-attribute"><span class="secno">4.10.7.2.8 </span>The <code title="attr-input-pattern">pattern</code> attribute</a></li><li><a href="common-input-element-attributes.html#the-min-and-max-attributes"><span class="secno">4.10.7.2.9 </span>The <code title="attr-input-min">min</code> and <code title="attr-input-max">max</code> attributes</a></li><li><a href="common-input-element-attributes.html#the-step-attribute"><span class="secno">4.10.7.2.10 </span>The <code title="attr-input-step">step</code> attribute</a></li><li><a href="common-input-element-attributes.html#the-placeholder-attribute"><span class="secno">4.10.7.2.11 </span>The <code title="attr-input-placeholder">placeholder</code> attribute</a></li></ol></li><li><a href="common-input-element-attributes.html#common-input-element-apis"><span class="secno">4.10.7.3 </span>Common <code>input</code> element APIs</a></li><li><a href="common-input-element-attributes.html#common-event-behaviors"><span class="secno">4.10.7.4 </span>Common event behaviors</a></li></ol></li></ol></li></ol></li></ol></div>
                    336: 
1.14      mike      337:   <h5 id="common-input-element-attributes"><span class="secno">4.10.7.2 </span>Common <code><a href="the-input-element.html#the-input-element">input</a></code> element attributes</h5><div class="impl">
1.1       mike      338: 
                    339:   <p>These attributes only apply to an <code><a href="the-input-element.html#the-input-element">input</a></code> element if
                    340:   its <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute is in a
                    341:   state whose definition declares that the attribute applies. When an
                    342:   attribute doesn't apply to an <code><a href="the-input-element.html#the-input-element">input</a></code> element, user
                    343:   agents must <a href="infrastructure.html#ignore">ignore</a> the attribute, regardless of the
                    344:   requirements and definitions below.</p>
                    345: 
1.14      mike      346:   </div><h6 id="the-autocomplete-attribute"><span class="secno">4.10.7.2.1 </span>The <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code> attribute</h6><p>User agents sometimes have features for helping users fill forms
1.1       mike      347:   in, for example prefilling the user's address based on earlier user
                    348:   input.</p><p>The <dfn id="attr-input-autocomplete" title="attr-input-autocomplete"><code>autocomplete</code></dfn>
                    349:   attribute is an <a href="common-microsyntaxes.html#enumerated-attribute">enumerated attribute</a>. The attribute has
                    350:   three states. The <code title="attr-input-autocomplete-on">on</code>
                    351:   keyword maps to the <dfn id="attr-input-autocomplete-on-state" title="attr-input-autocomplete-on-state">on</dfn> state, and the
                    352:   <code title="attr-input-autocomplete-off">off</code> keyword maps to
                    353:   the <dfn id="attr-input-autocomplete-off-state" title="attr-input-autocomplete-off-state">off</dfn>
                    354:   state. The attribute may also be omitted. The <i>missing value
                    355:   default</i> is the <dfn id="attr-input-autocomplete-default-state" title="attr-input-autocomplete-default-state">default</dfn>
                    356:   state.</p><p>The <a href="#attr-input-autocomplete-off-state" title="attr-input-autocomplete-off-state">off</a>
                    357:   state indicates either that the control's input data is particularly
                    358:   sensitive (for example the activation code for a nuclear weapon); or
                    359:   that it is a value that will never be reused (for example a
                    360:   one-time-key for a bank login) and the user will therefore have to
                    361:   explicitly enter the data each time, instead of being able to rely
                    362:   on the UA to prefill the value for him; or that the document
                    363:   provides its own autocomplete mechanism and does not want the user
                    364:   agent to provide autocompletion values.</p><p>Conversely, the <a href="#attr-input-autocomplete-on-state" title="attr-input-autocomplete-on-state">on</a> state indicates
                    365:   that the value is not particularly sensitive and the user can expect
                    366:   to be able to rely on his user agent to remember values he has
                    367:   entered for that control.</p><p>The <a href="#attr-input-autocomplete-default-state" title="attr-input-autocomplete-default-state">default</a> state
                    368:   indicates that the user agent is to use the <code title="attr-form-autocomplete"><a href="forms.html#attr-form-autocomplete">autocomplete</a></code> attribute on the
                    369:   element's <a href="association-of-controls-and-forms.html#form-owner">form owner</a> instead. (By default, the <code title="attr-form-autocomplete"><a href="forms.html#attr-form-autocomplete">autocomplete</a></code> attribute of
                    370:   <code><a href="forms.html#the-form-element">form</a></code> elements is in the <a href="forms.html#attr-form-autocomplete-on-state" title="attr-form-autocomplete-on-state">on</a> state.)</p><div class="impl">
                    371: 
                    372:   <p>Each <code><a href="the-input-element.html#the-input-element">input</a></code> element has a <dfn id="resulting-autocompletion-state">resulting
                    373:   autocompletion state</dfn>, which is either <i title="">on</i> or <i title="">off</i>.</p>
                    374: 
                    375:   <p>When an <code><a href="the-input-element.html#the-input-element">input</a></code> element is in one of the following
                    376:   conditions, the <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="#resulting-autocompletion-state">resulting
                    377:   autocompletion state</a> is <i title="">on</i>; otherwise, the
                    378:   <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="#resulting-autocompletion-state">resulting autocompletion
                    379:   state</a> is <i title="">off</i>:</p>
                    380: 
                    381:   <ul class="brief"><li>Its <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>
                    382:    attribute is in the <a href="#attr-input-autocomplete-on-state" title="attr-input-autocomplete-on-state">on</a> state.</li>
                    383: 
                    384:    <li>Its <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>
                    385:    attribute is in the <a href="#attr-input-autocomplete-default-state" title="attr-input-autocomplete-default-state">default</a> state,
                    386:    and the element has no <a href="association-of-controls-and-forms.html#form-owner">form owner</a>.</li>
                    387: 
                    388:    <li>Its <code title="attr-input-autocomplete"><a href="#attr-input-autocomplete">autocomplete</a></code>
                    389:    attribute is in the <a href="#attr-input-autocomplete-default-state" title="attr-input-autocomplete-default-state">default</a> state,
                    390:    and the element's <a href="association-of-controls-and-forms.html#form-owner">form owner</a>'s <code title="attr-form-autocomplete"><a href="forms.html#attr-form-autocomplete">autocomplete</a></code> attribute is in
                    391:    the <a href="forms.html#attr-form-autocomplete-on-state" title="attr-form-autocomplete-on-state">on</a>
                    392:    state.</li>
                    393: 
                    394:   </ul><p>When an <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="#resulting-autocompletion-state">resulting
                    395:   autocompletion state</a> is <i title="">on</i>, the user agent
                    396:   may store the value entered by the user so that if the user returns
                    397:   to the page, the UA can prefill the form. Otherwise, the user agent
                    398:   should not remember the control's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, and should not offer past
                    399:   values to the user.</p>
                    400: 
                    401:   <p>In addition, if the <a href="#resulting-autocompletion-state">resulting autocompletion state</a>
                    402:   is <i title="">off</i>, <a href="history.html#history-autocomplete">values are
                    403:   reset</a> when <a href="history.html#traverse-the-history" title="traverse the history">traversing the
                    404:   history</a>.</p>
                    405: 
                    406:   <p>The autocompletion mechanism must be implemented by the user
                    407:   agent acting as if the user had modified the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, and must be done at a time
                    408:   where the element is <i title="concept-input-mutable"><a href="the-input-element.html#concept-input-mutable">mutable</a></i>
                    409:   (e.g. just after the element has been inserted into the document, or
                    410:   when the user agent <a href="the-end.html#stop-parsing" title="stop parsing">stops
                    411:   parsing</a>).</p>
                    412: 
                    413:   </div><div class="example">
                    414: 
                    415:    <p>Banks frequently do not want UAs to prefill login
                    416:    information:</p>
                    417: 
                    418:    <pre>&lt;p&gt;&lt;label&gt;Account: &lt;input type="text" name="ac" autocomplete="off"&gt;&lt;/label&gt;&lt;/p&gt;
                    419: &lt;p&gt;&lt;label&gt;PIN: &lt;input type="password" name="pin" autocomplete="off"&gt;&lt;/label&gt;&lt;/p&gt;</pre>
                    420: 
                    421:   </div><div class="impl">
                    422: 
                    423:   <p>A user agent may allow the user to override the <a href="#resulting-autocompletion-state">resulting
                    424:   autocompletion state</a> and set it to always <i title="">on</i>,
                    425:   always allowing values to be remembered and prefilled), or always <i title="">off</i>, never remembering values. However, the ability to
                    426:   override the <a href="#resulting-autocompletion-state">resulting autocompletion state</a> to <i title="">on</i> should not be trivially accessible, as there are
                    427:   significant security implications for the user if all values are
                    428:   always remembered, regardless of the site's preferences.</p>
                    429: 
1.14      mike      430:   </div><h6 id="the-list-attribute"><span class="secno">4.10.7.2.2 </span>The <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute</h6><p>The <dfn id="attr-input-list" title="attr-input-list"><code>list</code></dfn>
1.1       mike      431:   attribute is used to identify an element that lists predefined
1.13      mike      432:   options suggested to the user.</p><p>If present, its value must be the <a href="elements.html#concept-id" title="concept-id">ID</a> of a <code><a href="the-button-element.html#the-datalist-element">datalist</a></code>
1.1       mike      433:   element in the same document.</p><div class="impl">
                    434: 
                    435:   <p>The <dfn id="concept-input-list" title="concept-input-list">suggestions source
                    436:   element</dfn> is the first element in the document in <a href="infrastructure.html#tree-order">tree
1.13      mike      437:   order</a> to have an <a href="elements.html#concept-id" title="concept-id">ID</a> equal to the value of the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute, if that element is a
1.1       mike      438:   <code><a href="the-button-element.html#the-datalist-element">datalist</a></code> element. If there is no <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute, or if there is no
1.13      mike      439:   element with that <a href="elements.html#concept-id" title="concept-id">ID</a>, or if the first element with that <a href="elements.html#concept-id" title="concept-id">ID</a> is not a
1.1       mike      440:   <code><a href="the-button-element.html#the-datalist-element">datalist</a></code> element, then there is no <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>.</p>
                    441: 
                    442:   <p>If there is a <a href="#concept-input-list" title="concept-input-list">suggestions source
                    443:   element</a>, then, when the user agent is allowing the user to
                    444:   edit the <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, the user agent should offer
                    445:   the suggestions represented by the <a href="#concept-input-list" title="concept-input-list">suggestions source element</a> to the
                    446:   user in a manner suitable for the type of control used. The user
                    447:   agent may use the suggestion's <a href="the-button-element.html#concept-option-label" title="concept-option-label">label</a> to identify the suggestion
                    448:   if appropriate. If the user selects a suggestion, then the
                    449:   <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> must be set to the selected
                    450:   suggestion's <a href="the-button-element.html#concept-option-value" title="concept-option-value">value</a>, as if
                    451:   the user had written that value himself.</p>
                    452: 
                    453:   <p>User agents must filter the suggestions to hide suggestions that
                    454:   the user would not be allowed to enter as the <code><a href="the-input-element.html#the-input-element">input</a></code>
                    455:   element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, and should
                    456:   filter the suggestions to hide suggestions that would cause the
                    457:   element to not <a href="association-of-controls-and-forms.html#concept-fv-valid" title="concept-fv-valid">satisfy its
                    458:   constraints</a>.</p>
                    459: 
                    460:   <hr><p>If the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute does
                    461:   not apply, there is no <a href="#concept-input-list" title="concept-input-list">suggestions
                    462:   source element</a>.</p>
                    463: 
                    464:   </div><div class="example">
                    465: 
                    466:    <p>This URL field offers some suggestions.</p>
                    467: 
                    468:    <pre>&lt;label&gt;Homepage: &lt;input name=hp type=url list=hpurls&gt;&lt;/label&gt;
                    469: &lt;datalist id=hpurls&gt;
                    470:  &lt;option value="http://www.google.com/" label="Google"&gt;
                    471:  &lt;option value="http://www.reddit.com/" label="Reddit"&gt;
                    472: &lt;/datalist&gt;</pre>
                    473: 
                    474:    <p>Other URLs from the user's history might show also; this is up
                    475:    to the user agent.</p>
                    476: 
                    477:   </div><div class="example">
                    478: 
                    479:    <p>This example demonstrates how to design a form that uses the
                    480:    autocompletion list feature while still degrading usefully in
                    481:    legacy user agents.</p>
                    482: 
                    483:    <p>If the autocompletion list is merely an aid, and is not
                    484:    important to the content, then simply using a <code><a href="the-button-element.html#the-datalist-element">datalist</a></code>
                    485:    element with children <code><a href="the-button-element.html#the-option-element">option</a></code> elements is enough. To
                    486:    prevent the values from being rendered in legacy user agents, they
                    487:    should be placed inside the <code title="attr-option-value"><a href="the-button-element.html#attr-option-value">value</a></code> attribute instead of
                    488:    inline.</p>
                    489: 
                    490:    <pre>&lt;p&gt;
                    491:  &lt;label&gt;
                    492:   Enter a breed:
                    493:   &lt;input type="text" name="breed" list="breeds"&gt;
                    494:   &lt;datalist id="breeds"&gt;
                    495:    &lt;option value="Abyssinian"&gt;
                    496:    &lt;option value="Alpaca"&gt;
                    497:    &lt;!-- ... --&gt;
                    498:   &lt;/datalist&gt;
                    499:  &lt;/label&gt;
                    500: &lt;/p&gt;</pre>
                    501: 
                    502:    <p>However, if the values need to be shown in legacy UAs, then
                    503:    fallback content can be placed inside the <code><a href="the-button-element.html#the-datalist-element">datalist</a></code>
                    504:    element, as follows:</p>
                    505: 
                    506:    <pre>&lt;p&gt;
                    507:  &lt;label&gt;
                    508:   Enter a breed:
                    509:   &lt;input type="text" name="breed" list="breeds"&gt;
                    510:  &lt;/label&gt;
                    511:  &lt;datalist id="breeds"&gt;
                    512:   &lt;label&gt;
                    513:    or select one from the list:
                    514:    &lt;select name="breed"&gt;
                    515:     &lt;option value=""&gt; (none selected)
                    516:     &lt;option&gt;Abyssinian
                    517:     &lt;option&gt;Alpaca
                    518:     &lt;!-- ... --&gt;
                    519:    &lt;/select&gt;
                    520:   &lt;/label&gt;
                    521:  &lt;/datalist&gt;
                    522: &lt;/p&gt;
                    523: </pre>
                    524: 
                    525:    <p>The fallback content will only be shown in UAs that don't
                    526:    support <code><a href="the-button-element.html#the-datalist-element">datalist</a></code>. The options, on the other hand, will
                    527:    be detected by all UAs, even though they are not direct children of
                    528:    the <code><a href="the-button-element.html#the-datalist-element">datalist</a></code> element.</p>
                    529: 
                    530:    <p>Note that if an <code><a href="the-button-element.html#the-option-element">option</a></code> element used in a
                    531:    <code><a href="the-button-element.html#the-datalist-element">datalist</a></code> is <code title="attr-option-selected"><a href="the-button-element.html#attr-option-selected">selected</a></code>, it will be selected
                    532:    by default by legacy UAs (because it affects the
                    533:    <code><a href="the-button-element.html#the-select-element">select</a></code>), but it will not have any effect on the
                    534:    <code><a href="the-input-element.html#the-input-element">input</a></code> element in UAs that support
                    535:    <code><a href="the-button-element.html#the-datalist-element">datalist</a></code>.</p>
                    536: 
1.14      mike      537:   </div><h6 id="the-readonly-attribute"><span class="secno">4.10.7.2.3 </span>The <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute</h6><p>The <dfn id="attr-input-readonly" title="attr-input-readonly"><code>readonly</code></dfn>
1.1       mike      538:   attribute is a <a href="common-microsyntaxes.html#boolean-attribute">boolean attribute</a> that controls whether
1.12      mike      539:   or not the user can edit the form control. <span class="impl">When
1.1       mike      540:   specified, the element is <i title="concept-input-immutable"><a href="the-input-element.html#concept-input-immutable">immutable</a></i>.</span></p><div class="impl">
                    541: 
                    542:   <p><strong>Constraint validation</strong>: If the <code title="attr-input-readonly"><a href="#attr-input-readonly">readonly</a></code> attribute is specified
                    543:   on an <code><a href="the-input-element.html#the-input-element">input</a></code> element, the element is <a href="association-of-controls-and-forms.html#barred-from-constraint-validation">barred from
                    544:   constraint validation</a>.</p>
                    545: 
                    546:   </div><div class="example">
                    547: 
                    548:    <p>In the following example, the existing product identifiers
                    549:    cannot be modified, but they are still displayed as part of the
                    550:    form, for consistency with the row representing a new product
                    551:    (where the identifier is not yet filled in).</p>
                    552: 
                    553:    <pre>&lt;form action="products.cgi" method=post enctype="multipart/form-data"&gt;
                    554:  &lt;table&gt;
                    555:   &lt;tr&gt; &lt;th&gt; Product ID &lt;th&gt; Product name &lt;th&gt; Price &lt;th&gt; Action
                    556:   &lt;tr&gt;
                    557:    &lt;td&gt; &lt;input readonly name="1.pid" value="H412"&gt;
                    558:    &lt;td&gt; &lt;input required name="1.pname" value="Floor lamp Ulke"&gt;
                    559:    &lt;td&gt; $&lt;input required type=number min=0 step=0.01 name="1.pprice" value="49.99"&gt;
                    560:    &lt;td&gt; &lt;button formnovalidate name="action" value="delete:1"&gt;Delete&lt;/button&gt;
                    561:   &lt;tr&gt;
                    562:    &lt;td&gt; &lt;input readonly name="2.pid" value="FG28"&gt;
                    563:    &lt;td&gt; &lt;input required name="2.pname" value="Table lamp Ulke"&gt;
                    564:    &lt;td&gt; $&lt;input required type=number min=0 step=0.01 name="2.pprice" value="24.99"&gt;
                    565:    &lt;td&gt; &lt;button formnovalidate name="action" value="delete:2"&gt;Delete&lt;/button&gt;
                    566:   &lt;tr&gt;
                    567:    &lt;td&gt; &lt;input required name="3.pid" value="" pattern="[A-Z0-9]+"&gt;
                    568:    &lt;td&gt; &lt;input required name="3.pname" value=""&gt;
                    569:    &lt;td&gt; $&lt;input required type=number min=0 step=0.01 name="3.pprice" value=""&gt;
                    570:    &lt;td&gt; &lt;button formnovalidate name="action" value="delete:3"&gt;Delete&lt;/button&gt;
                    571:  &lt;/table&gt;
                    572:  &lt;p&gt; &lt;button formnovalidate name="action" value="add"&gt;Add&lt;/button&gt; &lt;/p&gt;
                    573:  &lt;p&gt; &lt;button name="action" value="update"&gt;Save&lt;/button&gt; &lt;/p&gt;
                    574: &lt;/form&gt;</pre>
                    575: 
1.14      mike      576:   </div><h6 id="the-size-attribute"><span class="secno">4.10.7.2.4 </span>The <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute</h6><p>The <dfn id="attr-input-size" title="attr-input-size"><code>size</code></dfn>
1.1       mike      577:   attribute gives the number of characters that, in a visual
                    578:   rendering, the user agent is to allow the user to see while editing
                    579:   the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>.</p><p>The <code title="attr-input-size"><a href="#attr-input-size">size</a></code> attribute, if
                    580:   specified, must have a value that is a <a href="common-microsyntaxes.html#valid-non-negative-integer">valid non-negative
                    581:   integer</a> greater than zero.</p><div class="impl">
                    582: 
                    583:   <p>If the attribute is present, then its value must be parsed using
                    584:   the <a href="common-microsyntaxes.html#rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</a>, and if the
                    585:   result is a number greater than zero, then the user agent should
                    586:   ensure that at least that many characters are visible.</p>
                    587: 
                    588:   <p>The <code title="dom-input-size"><a href="the-input-element.html#dom-input-size">size</a></code> IDL attribute is
                    589:   <a href="common-dom-interfaces.html#limited-to-only-non-negative-numbers-greater-than-zero">limited to only non-negative numbers greater than
1.17      mike      590:   zero</a> and has a default value of 20.</p>
1.1       mike      591: 
1.14      mike      592:   </div><h6 id="the-required-attribute"><span class="secno">4.10.7.2.5 </span>The <code title="attr-input-required"><a href="#attr-input-required">required</a></code> attribute</h6><p>The <dfn id="attr-input-required" title="attr-input-required"><code>required</code></dfn>
1.1       mike      593:   attribute is a <a href="common-microsyntaxes.html#boolean-attribute">boolean attribute</a>. When specified, the
                    594:   element is <dfn id="concept-input-required" title="concept-input-required"><i>required</i></dfn>.</p><div class="impl">
                    595: 
                    596:   <p><strong>Constraint validation</strong>: If the element is <i title="concept-input-required"><a href="#concept-input-required">required</a></i>, and its <code title="dom-input-value"><a href="#dom-input-value">value</a></code> IDL attribute applies and is in
                    597:   the mode <a href="#dom-input-value-value" title="dom-input-value-value">value</a>, and the
                    598:   element is <i title="concept-input-mutable"><a href="the-input-element.html#concept-input-mutable">mutable</a></i>, and the
                    599:   element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> is the empty
                    600:   string, then the element is <a href="association-of-controls-and-forms.html#suffering-from-being-missing">suffering from being
                    601:   missing</a>.</p>
                    602: 
                    603:   </div><div class="example">
                    604: 
                    605:    <p>The following form has two required fields, one for an e-mail
                    606:    address and one for a password. It also has a third field that is
                    607:    only considerd valid if the user types the same password in the
                    608:    password field and this third field.</p>
                    609: 
                    610:    <pre>&lt;h1&gt;Create new account&lt;/h1&gt;
                    611: &lt;form action="/newaccount" method=post&gt;
                    612:  &lt;p&gt;
                    613:   &lt;label for="username"&gt;E-mail address:&lt;/label&gt;
                    614:   &lt;input id="username" type=email required name=un&gt;
                    615:  &lt;p&gt;
                    616:   &lt;label for="password1"&gt;Password:&lt;/label&gt;
                    617:   &lt;input id="password1" type=password required name=up&gt;
                    618:  &lt;p&gt;
                    619:   &lt;label for="password2"&gt;Confirm password:&lt;/label&gt;
                    620:   &lt;input id="password2" type=password onforminput="setCustomValidity(value != password1.value ? 'Passwords do not match.' : '')"&gt;
                    621:  &lt;p&gt;
                    622:   &lt;input type=submit value="Create account"&gt;
                    623: &lt;/form&gt;</pre>
                    624: 
1.14      mike      625:   </div><h6 id="the-multiple-attribute"><span class="secno">4.10.7.2.6 </span>The <code title="attr-input-multiple"><a href="#attr-input-multiple">multiple</a></code> attribute</h6><p>The <dfn id="attr-input-multiple" title="attr-input-multiple"><code>multiple</code></dfn>
1.1       mike      626:   attribute is a <a href="common-microsyntaxes.html#boolean-attribute">boolean attribute</a> that indicates whether
                    627:   the user is to be allowed to specify more than one value.</p><div class="example">
                    628: 
                    629:    <p>The following extract shows how an e-mail client's "Cc" field
                    630:    could accept multiple e-mail addresses.</p>
                    631: 
                    632:    <pre>&lt;label&gt;Cc: &lt;input type=email multiple name=cc&gt;&lt;/label&gt;</pre>
                    633: 
                    634:    <p>If the user had, amongst many friends in his user contacts
                    635:    database, two friends "Arthur Dent" (with address
                    636:    "art@example.net") and "Adam Josh" (with address
                    637:    "adamjosh@example.net"), then, after the user has typed "a", the
                    638:    user agent might suggest these two e-mail addresses to the
                    639:    user.</p>
                    640: 
1.15      mike      641:    <p><img alt="" height="140" src="http://dev.w3.org/html5/spec/images/sample-email-1.png" width="500"></p>
1.1       mike      642: 
                    643:    <p>The page could also link in the user's contacts database from the site:</p>
                    644: 
                    645:    <pre>&lt;label&gt;Cc: &lt;input type=email multiple name=cc list=contacts&gt;&lt;/label&gt;
                    646: ...
                    647: &lt;datalist id="contacts"&gt;
                    648:  &lt;option value="hedral@damowmow.com"&gt;
                    649:  &lt;option value="pillar@example.com"&gt;
                    650:  &lt;option value="astrophy@cute.example"&gt;
                    651:  &lt;option value="astronomy@science.example.org"&gt;
                    652: &lt;/datalist&gt;</pre>
                    653: 
                    654:    <p>Suppose the user had entered "bob@example.net" into this text
                    655:    field, and then started typing a second e-mail address starting
                    656:    with "a". The user agent might show both the two friends mentioned
                    657:    earlier, as well as the "astrophy" and "astronomy" values given in
                    658:    the <code><a href="the-button-element.html#the-datalist-element">datalist</a></code> element.</p>
                    659: 
1.15      mike      660:    <p><img alt="" height="171" src="http://dev.w3.org/html5/spec/images/sample-email-2.png" width="500"></p>
1.1       mike      661: 
                    662:   </div><div class="example">
                    663: 
                    664:    <p>The following extract shows how an e-mail client's "Attachments"
                    665:    field could accept multiple files for upload.</p>
                    666: 
                    667:    <pre>&lt;label&gt;Attachments: &lt;input type=file multiple name=att&gt;&lt;/label&gt;</pre>
                    668: 
1.14      mike      669:   </div><h6 id="the-maxlength-attribute"><span class="secno">4.10.7.2.7 </span>The <code title="attr-input-maxlength"><a href="#attr-input-maxlength">maxlength</a></code> attribute</h6><p>The <dfn id="attr-input-maxlength" title="attr-input-maxlength"><code>maxlength</code></dfn>
1.1       mike      670:   attribute<span class="impl">, when it applies,</span> is a <a href="association-of-controls-and-forms.html#attr-fe-maxlength" title="attr-fe-maxlength">form control <code title="">maxlength</code> attribute</a><span class="impl">
                    671:   controlled by the <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="the-input-element.html#concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value
                    672:   flag</a></span>.</p><p>If the <code><a href="the-input-element.html#the-input-element">input</a></code> element has a <a href="association-of-controls-and-forms.html#maximum-allowed-value-length">maximum allowed
                    673:   value length</a>, then the <a href="common-microsyntaxes.html#code-point-length">code-point length</a> of the
                    674:   value of the element's <code title="attr-input-value"><a href="the-input-element.html#attr-input-value">value</a></code>
                    675:   attribute must be equal to or less than the element's <a href="association-of-controls-and-forms.html#maximum-allowed-value-length">maximum
                    676:   allowed value length</a>.</p><div class="example">
                    677: 
                    678:    <p>The following extract shows how a messaging client's text entry
                    679:    could be arbitrarily restricted to a fixed number of characters,
1.15      mike      680:    thus forcing any conversation through this medium to be terse and
1.1       mike      681:    discouraging intelligent discourse.</p>
                    682: 
                    683:    <pre>What are you doing? &lt;input name=status maxlength=140&gt;</pre>
                    684: 
1.14      mike      685:   </div><h6 id="the-pattern-attribute"><span class="secno">4.10.7.2.8 </span>The <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute</h6><p>The <dfn id="attr-input-pattern" title="attr-input-pattern"><code>pattern</code></dfn>
1.1       mike      686:   attribute specifies a regular expression against which the control's
                    687:   <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> is to be checked.</p><p>If specified, the attribute's value must match the JavaScript <i title="">Pattern</i> production. <a href="references.html#refsECMA262">[ECMA262]</a></p><div class="impl">
                    688: 
                    689:   <p><strong>Constraint validation</strong>: If the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> is not the empty string, and
                    690:   the element's <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>
                    691:   attribute is specified and the attribute's value, when compiled as a
                    692:   JavaScript regular expression with the <code title="">global</code>,
                    693:   <code title="">ignoreCase</code>, and <code title="">multiline</code> flags <em>disabled</em> (see ECMA262
                    694:   Edition 5, sections 15.10.7.2 through 15.10.7.4), compiles
                    695:   successfully but the resulting regular expression does not match the
                    696:   entirety of the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, then the element is
                    697:   <a href="association-of-controls-and-forms.html#suffering-from-a-pattern-mismatch">suffering from a pattern mismatch</a>. <a href="references.html#refsECMA262">[ECMA262]</a></p>
                    698: 
                    699:   <p class="note">This implies that the regular expression language
                    700:   used for this attribute is the same as that used in JavaScript,
                    701:   except that the <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code>
                    702:   attribute must match the entire value, not just any subset (somewhat
                    703:   as if it implied a <code title="">^(?:</code> at the start of the
                    704:   pattern and a <code title="">)$</code> at the end).</p>
                    705: 
                    706:   </div><p>When an <code><a href="the-input-element.html#the-input-element">input</a></code> element has a <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute specified,
                    707:   authors should include a <code title="attr-title"><a href="elements.html#the-title-attribute">title</a></code>
                    708:   attribute to give a description of the pattern. User agents may use
                    709:   the contents of this attribute, if it is present, when informing the
                    710:   user that the pattern is not matched, or at any other suitable time,
                    711:   such as in a tooltip or read out by assistive technology when the
                    712:   control gains focus.</p><div class="example">
                    713:    <p>For example, the following snippet:</p>
                    714:    <pre>&lt;label&gt; Part number:
                    715:  &lt;input pattern="[0-9][A-Z]{3}" name="part"
                    716:         title="A part number is a digit followed by three uppercase letters."/&gt;
                    717: &lt;/label&gt;</pre>
                    718:    <p>...could cause the UA to display an alert such as:</p>
                    719:    <pre><samp>A part number is a digit followed by three uppercase letters.
1.11      mike      720: You cannot submit this form when the field is incorrect.</samp></pre>
1.1       mike      721:   </div><p>When a control has a <code title="attr-input-pattern"><a href="#attr-input-pattern">pattern</a></code> attribute, the <code title="attr-title"><a href="elements.html#the-title-attribute">title</a></code> attribute, if used, must describe
                    722:   the pattern.  Additional information could also be included, so long
                    723:   as it assists the user in filling in the control. Otherwise,
                    724:   assistive technology would be impaired.</p><p class="example">For instance, if the title attribute contained
                    725:   the caption of the control, assistive technology could end up saying
                    726:   something like <samp>The text you have entered does not match the
                    727:   required pattern. Birthday</samp>, which is not useful.</p><p>UAs may still show the <code><a href="semantics.html#the-title-element-0">title</a></code> in non-error situations
                    728:   (for example, as a tooltip when hovering over the control), so
                    729:   authors should be careful not to word <code><a href="semantics.html#the-title-element-0">title</a></code>s as if an
1.14      mike      730:   error has necessarily occurred.</p><h6 id="the-min-and-max-attributes"><span class="secno">4.10.7.2.9 </span>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> and <code title="attr-input-max"><a href="#attr-input-max">max</a></code> attributes</h6><p>The <dfn id="attr-input-min" title="attr-input-min"><code>min</code></dfn> and <dfn id="attr-input-max" title="attr-input-max"><code>max</code></dfn> attributes indicate
1.1       mike      731:   the allowed range of values for the element.</p><div class="impl">
                    732: 
                    733:   <p>Their syntax is defined by the section that defines the <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state.</p>
                    734: 
                    735:   <p>If the element has a <code title="attr-input-min"><a href="#attr-input-min">min</a></code>
                    736:   attribute, and the result of applying the <a href="the-input-element.html#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
                    737:   string to a number</a> to the value of the <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute is a number, then that
                    738:   number is the element's <dfn id="concept-input-min" title="concept-input-min">minimum</dfn>; otherwise, if the <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state
                    739:   defines a <dfn id="concept-input-min-default" title="concept-input-min-default">default
                    740:   minimum</dfn>, then that is the <a href="#concept-input-min" title="concept-input-min">minimum</a>; otherwise, the element has
                    741:   no <a href="#concept-input-min" title="concept-input-min">minimum</a>.</p>
                    742: 
                    743:   <p><strong>Constraint validation</strong>: When the element has a
                    744:   <a href="#attr-input-min" title="attr-input-min">minimum</a>, and the result of
                    745:   applying the <a href="the-input-element.html#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
                    746:   string to a number</a> to the string given by the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> is a number, and the number
                    747:   obtained from that algorithm is less than the <a href="#attr-input-min" title="attr-input-min">minimum</a>, the element is
                    748:   <a href="association-of-controls-and-forms.html#suffering-from-an-underflow">suffering from an underflow</a>.</p>
                    749: 
                    750:   <p>The <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute also
                    751:   defines the <a href="#concept-input-min-zero" title="concept-input-min-zero">step
                    752:   base</a>.</p>
                    753: 
                    754:   <p>If the element has a <code title="attr-input-max"><a href="#attr-input-max">max</a></code>
                    755:   attribute, and the result of applying the <a href="the-input-element.html#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
                    756:   string to a number</a> to the value of the <code title="attr-input-max"><a href="#attr-input-max">max</a></code> attribute is a number, then that
                    757:   number is the element's <dfn id="concept-input-max" title="concept-input-max">maximum</dfn>; otherwise, if the <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state
                    758:   defines a <dfn id="concept-input-max-default" title="concept-input-max-default">default
                    759:   maximum</dfn>, then that is the <a href="#concept-input-max" title="concept-input-max">maximum</a>; otherwise, the element has
                    760:   no <a href="#concept-input-max" title="concept-input-max">maximum</a>.</p>
                    761: 
                    762:   <p><strong>Constraint validation</strong>: When the element has a
                    763:   <a href="#attr-input-max" title="attr-input-max">maximum</a>, and the result of
                    764:   applying the <a href="the-input-element.html#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
                    765:   string to a number</a> to the string given by the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> is a number, and the number
                    766:   obtained from that algorithm is more than the <a href="#attr-input-max" title="attr-input-max">maximum</a>, the element is
                    767:   <a href="association-of-controls-and-forms.html#suffering-from-an-overflow">suffering from an overflow</a>.</p>
                    768: 
                    769:   </div><p>The <code title="attr-input-max"><a href="#attr-input-max">max</a></code> attribute's value
                    770:   (the <a href="#concept-input-max" title="concept-input-max">maximum</a>) must not be
                    771:   less than the <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute's
                    772:   value (its <a href="#concept-input-min" title="concept-input-min">minimum</a>).</p><div class="impl">
                    773: 
                    774:   <p class="note">If an element has a <a href="#attr-input-max" title="attr-input-max">maximum</a> that is less than its <a href="#attr-input-min" title="attr-input-min">minimum</a>, then so long as the element
                    775:   has a <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, it will either be
                    776:   <a href="association-of-controls-and-forms.html#suffering-from-an-underflow">suffering from an underflow</a> or <a href="association-of-controls-and-forms.html#suffering-from-an-overflow">suffering from an
                    777:   overflow</a>.</p>
                    778: 
                    779:   </div><div class="example">
                    780: 
                    781:    <p>The following date control limits input to dates that are before
                    782:    the 1980s:</p>
                    783: 
                    784:    <pre>&lt;input name=bday type=date max="1979-12-31"&gt;</pre>
                    785: 
                    786:   </div><div class="example">
                    787: 
                    788:    <p>The following number control limits input to whole numbers
                    789:    greater than zero:</p>
                    790: 
                    791:    <pre>&lt;input name=quantity required type=number min=1 value=1&gt;</pre>
                    792: 
1.14      mike      793:   </div><h6 id="the-step-attribute"><span class="secno">4.10.7.2.10 </span>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute</h6><p>The <dfn id="attr-input-step" title="attr-input-step"><code>step</code></dfn>
1.1       mike      794:   attribute indicates the granularity that is expected (and required)
                    795:   of the <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, by limiting the
                    796:   allowed values. <span class="impl">The section that defines the
                    797:   <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state
                    798:   also defines the <dfn id="concept-input-step-default" title="concept-input-step-default">default
                    799:   step</dfn>, the <dfn id="concept-input-step-scale" title="concept-input-step-scale">step scale
                    800:   factor</dfn>, and in some cases the <dfn id="concept-input-step-default-base" title="concept-input-step-default-base">default step base</dfn>,
                    801:   which are used in processing the attribute as described
                    802:   below.</span></p><p>The <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute, if
                    803:   specified, must either have a value that is a <a href="common-microsyntaxes.html#valid-floating-point-number">valid floating
                    804:   point number</a> that <a href="common-microsyntaxes.html#rules-for-parsing-floating-point-number-values" title="rules for parsing floating
                    805:   point number values">parses</a> to a number that is greater than
                    806:   zero, or must have a value that is an <a href="infrastructure.html#ascii-case-insensitive">ASCII
                    807:   case-insensitive</a> match for the string "<code title="">any</code>".</p><div class="impl">
                    808: 
                    809:   <p>The attribute provides the <dfn id="concept-input-step" title="concept-input-step">allowed value step</dfn> for the element,
                    810:   as follows:</p>
                    811: 
                    812:   <ol><li>If the attribute is absent, then the <a href="#concept-input-step" title="concept-input-step">allowed value step</a> is the <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> multiplied
                    813:    by the <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale
                    814:    factor</a>.</li>
                    815: 
                    816:    <li>Otherwise, if the attribute's value is an <a href="infrastructure.html#ascii-case-insensitive">ASCII
                    817:    case-insensitive</a> match for the string "<code title="">any</code>", then there is no <a href="#concept-input-step" title="concept-input-step">allowed value step</a>.</li>
                    818: 
                    819:    <li>Otherwise, if the <a href="common-microsyntaxes.html#rules-for-parsing-floating-point-number-values">rules for parsing floating point number
                    820:    values</a>, when they are applied to the attribute's value,
                    821:    return an error, zero, or a number less than zero, then the <a href="#concept-input-step" title="concept-input-step">allowed value step</a> is the <a href="#concept-input-step-default" title="concept-input-step-default">default step</a> multiplied
                    822:    by the <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale
                    823:    factor</a>.</li>
                    824: 
                    825:    <li>Otherwise, the <a href="#concept-input-step" title="concept-input-step">allowed value
                    826:    step</a> is the number returned by the <a href="common-microsyntaxes.html#rules-for-parsing-floating-point-number-values">rules for parsing
                    827:    floating point number values</a> when they are applied to the
                    828:    attribute's value, multiplied by the <a href="#concept-input-step-scale" title="concept-input-step-scale">step scale factor</a>.</li>
                    829: 
                    830:   </ol><p>The <dfn id="concept-input-min-zero" title="concept-input-min-zero">step base</dfn> is the
                    831:   result of applying the <a href="the-input-element.html#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
                    832:   string to a number</a> to the value of the <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute, unless the element does
                    833:   not have a <code title="attr-input-min"><a href="#attr-input-min">min</a></code> attribute
                    834:   specified or the result of applying that algorithm is an error, in
                    835:   which case the <a href="#concept-input-min-zero" title="concept-input-min-zero">step base</a>
                    836:   is the <a href="#concept-input-step-default-base" title="concept-input-step-default-base">default step
                    837:   base</a>, if one is defined, or zero, if not.</p>
                    838: 
                    839:   <p><strong>Constraint validation</strong>: When the element has an
                    840:   <a href="#concept-input-step" title="concept-input-step">allowed value step</a>, and the
                    841:   result of applying the <a href="the-input-element.html#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
                    842:   string to a number</a> to the string given by the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> is a number, and that
                    843:   number subtracted from the <a href="#concept-input-min-zero" title="concept-input-min-zero">step
                    844:   base</a> is not an integral multiple of the <a href="#concept-input-step" title="concept-input-step">allowed value step</a>, the element is
                    845:   <a href="association-of-controls-and-forms.html#suffering-from-a-step-mismatch">suffering from a step mismatch</a>.</p>
                    846: 
                    847:   </div><div class="example">
                    848: 
                    849:    <p>The following range control only accepts values in the range
                    850:    0..1, and allows 256 steps in that range:</p>
                    851: 
                    852:    <pre>&lt;input name=opacity type=range min=0 max=1 step=0.00392156863&gt;</pre>
                    853: 
                    854:   </div><div class="example">
                    855: 
                    856:    <p>The following control allows any time in the day to be selected,
                    857:    with any accuracy (e.g. thousandth-of-a-second accuracy or
                    858:    more):</p>
                    859: 
                    860:    <pre>&lt;input name=favtime type=time step=any&gt;</pre>
                    861: 
                    862:    <p>Normally, time controls are limited to an accuracy of one
                    863:    minute.</p>
                    864: 
1.14      mike      865:   </div><h6 id="the-placeholder-attribute"><span class="secno">4.10.7.2.11 </span>The <code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code> attribute</h6><!-- similar text in the <textarea> section --><p>The <dfn id="attr-input-placeholder" title="attr-input-placeholder"><code>placeholder</code></dfn>
1.1       mike      866:   attribute represents a <em>short</em> hint (a word or short phrase)
                    867:   intended to aid the user with data entry. A hint could be a sample
                    868:   value or a brief description of the expected format. The attribute,
                    869:   if specified, must have a value that contains no U+000A LINE FEED
                    870:   (LF) or U+000D CARRIAGE RETURN (CR) characters.</p><p class="note">For a longer hint or other advisory text, the <code title="attr-title"><a href="elements.html#the-title-attribute">title</a></code> attribute is more appropriate.</p><p>The <code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>
                    871:   attribute should not be used as an alternative to a
                    872:   <code><a href="forms.html#the-label-element">label</a></code>.</p><div class="impl">
                    873: 
                    874:   <p>User agents should present this hint to the user, after having
                    875:   <a href="common-microsyntaxes.html#strip-line-breaks" title="strip line breaks">stripped line breaks</a> from it,
                    876:   when the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> is
                    877:   the empty string and the control is not focused (e.g. by displaying
                    878:   it inside a blank unfocused control).</p>
                    879: 
                    880:   </div><div class="example">
                    881: 
                    882:    <p>Here is an example of a mail configuration user interface that
                    883:    uses the <code title="attr-input-placeholder"><a href="#attr-input-placeholder">placeholder</a></code>
                    884:    attribute:</p>
                    885: 
                    886:    <pre>&lt;fieldset&gt;
                    887:  &lt;legend&gt;Mail Account&lt;/legend&gt;
                    888:  &lt;p&gt;&lt;label&gt;Name: &lt;input type="text" name="fullname" placeholder="John Ratzenberger"&gt;&lt;/label&gt;&lt;/p&gt;
                    889:  &lt;p&gt;&lt;label&gt;Address: &lt;input type="email" name="address" placeholder="john@example.net"&gt;&lt;/label&gt;&lt;/p&gt;
                    890:  &lt;p&gt;&lt;label&gt;Password: &lt;input type="password" name="password"&gt;&lt;/label&gt;&lt;/p&gt;
                    891:  &lt;p&gt;&lt;label&gt;Description: &lt;input type="text" name="desc" placeholder="My Email Account"&gt;&lt;/label&gt;&lt;/p&gt;
                    892: &lt;/fieldset&gt;</pre>
                    893: 
1.14      mike      894:   </div><h5 id="common-input-element-apis"><span class="secno">4.10.7.3 </span>Common <code><a href="the-input-element.html#the-input-element">input</a></code> element APIs</h5><dl class="domintro"><dt><var title="">input</var> . <code title="dom-input-value"><a href="#dom-input-value">value</a></code> [ = <var title="">value</var> ]</dt>
1.1       mike      895: 
                    896:    <dd>
                    897: 
                    898:     <p>Returns the current <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>
                    899:     of the form control.</p>
                    900: 
                    901:     <p>Can be set, to change the value.</p>
                    902: 
                    903:     <p>Throws an <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception if it is
                    904:     set to any value other than the empty string when the control is a
                    905:     file upload control.</p>
                    906: 
                    907:    </dd>
                    908: 
                    909:    <dt><var title="">input</var> . <code title="dom-input-checked"><a href="#dom-input-checked">checked</a></code> [ = <var title="">value</var> ]</dt>
                    910: 
                    911:    <dd>
                    912: 
                    913:     <p>Returns the current <a href="association-of-controls-and-forms.html#concept-fe-checked" title="concept-fe-checked">checkedness</a> of the form
                    914:     control.</p>
                    915: 
                    916:     <p>Can be set, to change the <a href="association-of-controls-and-forms.html#concept-fe-checked" title="concept-fe-checked">checkedness</a>.</p>
                    917: 
                    918:    </dd>
                    919: 
                    920:    <dt><var title="">input</var> . <code title="dom-input-files"><a href="#dom-input-files">files</a></code></dt>
                    921: 
                    922:    <dd>
                    923: 
                    924:     <p>Returns a <code>FileList</code> object listing the <a href="number-state.html#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a> of
                    925:     the form control.</p>
                    926: 
1.7       mike      927:     <p>Returns null if the control isn't a file control.</p>
1.1       mike      928: 
                    929:    </dd>
                    930: 
                    931:    <dt><var title="">input</var> . <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code> [ = <var title="">value</var> ]</dt>
                    932: 
                    933:    <dd>
                    934: 
                    935:     <p>Returns a <code>Date</code> object representing the form
                    936:     control's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, if
                    937:     applicable; otherwise, returns null.</p>
                    938: 
                    939:     <p>Can be set, to change the value.</p>
                    940: 
                    941:     <p>Throws an <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception if the
                    942:     control isn't date- or time-based.</p>
                    943: 
                    944:    </dd>
                    945: 
                    946:    <dt><var title="">input</var> . <code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> [ = <var title="">value</var> ]</dt>
                    947: 
                    948:    <dd>
                    949: 
                    950:     <p>Returns a number representing the form control's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, if applicable; otherwise,
                    951:     returns null.</p>
                    952: 
                    953:     <p>Can be set, to change the value.</p>
                    954: 
                    955:     <p>Throws an <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception if the
                    956:     control is neither date- or time-based nor numeric.</p>
                    957: 
                    958:    </dd>
                    959: 
                    960:    <dt><var title="">input</var> . <code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp</a></code>( [ <var title="">n</var> ] )</dt>
                    961:    <dt><var title="">input</var> . <code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown</a></code>( [ <var title="">n</var> ] )</dt>
                    962: 
                    963:    <dd>
                    964: 
                    965:     <p>Changes the form control's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> by the value given in the
                    966:     <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute, multiplied by
1.9       mike      967:     <var title="">n</var>. The default value for <var title="">n</var>
                    968:     is 1.</p>
1.1       mike      969: 
                    970:     <p>Throws <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception if the control
                    971:     is neither date- or time-based nor numeric, if the <code title="attr-input-step"><a href="#attr-input-step">step</a></code> attribute's value is "<code title="">any</code>", if the current <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> could not be parsed, or if
                    972:     stepping in the given direction by the given amount would take the
                    973:     value out of range.</p>
                    974: 
                    975:    </dd>
                    976: 
                    977:    <dt><var title="">input</var> . <code title="dom-input-list"><a href="#dom-input-list">list</a></code></dt>
                    978: 
                    979:    <dd>
                    980: 
                    981:     <p>Returns the <code><a href="the-button-element.html#the-datalist-element">datalist</a></code> element indicated by the
                    982:     <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute.</p>
                    983: 
                    984:    </dd>
                    985: 
                    986:    <dt><var title="">input</var> . <code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code></dt>
                    987: 
                    988:    <dd>
                    989: 
                    990:     <p>Returns the <code><a href="the-button-element.html#the-option-element">option</a></code> element from the
                    991:     <code><a href="the-button-element.html#the-datalist-element">datalist</a></code> element indicated by the <code title="attr-input-list"><a href="#attr-input-list">list</a></code> attribute that matches the
                    992:     form control's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>.</p>
                    993: 
                    994:    </dd>
                    995: 
                    996:   </dl><div class="impl">
                    997: 
                    998:   <p>The <dfn id="dom-input-value" title="dom-input-value"><code>value</code></dfn> IDL
                    999:   attribute allows scripts to manipulate the <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> of an <code><a href="the-input-element.html#the-input-element">input</a></code>
                   1000:   element. The attribute is in one of the following modes, which
                   1001:   define its behavior:</p>
                   1002: 
                   1003:   <dl><dt><dfn id="dom-input-value-value" title="dom-input-value-value">value</dfn>
                   1004: 
                   1005:    </dt><dd>On getting, it must return the current <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> of the element. On setting,
                   1006:    it must set the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> to the new value, set the
                   1007:    element's <a href="the-input-element.html#concept-input-value-dirty-flag" title="concept-input-value-dirty-flag">dirty value
                   1008:    flag</a> to true, and then invoke the <a href="the-input-element.html#value-sanitization-algorithm">value sanitization
                   1009:    algorithm</a>, if the element's <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state
                   1010:    defines one.</dd>
                   1011: 
                   1012:    <dt><dfn id="dom-input-value-default" title="dom-input-value-default">default</dfn>
                   1013: 
                   1014:    </dt><dd>On getting, if the element has a <code title="attr-input-value"><a href="the-input-element.html#attr-input-value">value</a></code> attribute, it must return
                   1015:    that attribute's value; otherwise, it must return the empty
                   1016:    string. On setting, it must set the element's <code title="attr-input-value"><a href="the-input-element.html#attr-input-value">value</a></code> attribute to the new
                   1017:    value.</dd>
                   1018: 
                   1019:    <dt><dfn id="dom-input-value-default-on" title="dom-input-value-default-on">default/on</dfn>
                   1020: 
                   1021:    </dt><dd>On getting, if the element has a <code title="attr-input-value"><a href="the-input-element.html#attr-input-value">value</a></code> attribute, it must return
                   1022:    that attribute's value; otherwise, it must return the string "<code title="">on</code>". On setting, it must set the element's <code title="attr-input-value"><a href="the-input-element.html#attr-input-value">value</a></code> attribute to the new
                   1023:    value.</dd>
                   1024: 
                   1025:    <dt><dfn id="dom-input-value-filename" title="dom-input-value-filename">filename</dfn>
                   1026: 
                   1027:    </dt><dd>On getting, it must return the string "<code title="">C:\fakepath\</code>" followed by the filename of the first
                   1028:    file in the list of <a href="number-state.html#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>, if
                   1029:    any, or the empty string if the list is empty. On setting, if the
                   1030:    new value is the empty string, it must empty the list of <a href="number-state.html#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>;
                   1031:    otherwise, it must throw an <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code>
                   1032:    exception.</dd>
                   1033: 
                   1034:   </dl><hr><p>The <dfn id="dom-input-checked" title="dom-input-checked"><code>checked</code></dfn> IDL
                   1035:   attribute allows scripts to manipulate the <a href="association-of-controls-and-forms.html#concept-fe-checked" title="concept-fe-checked">checkedness</a> of an
                   1036:   <code><a href="the-input-element.html#the-input-element">input</a></code> element. On getting, it must return the current
                   1037:   <a href="association-of-controls-and-forms.html#concept-fe-checked" title="concept-fe-checked">checkedness</a> of the element;
                   1038:   and on setting, it must set the element's <a href="association-of-controls-and-forms.html#concept-fe-checked" title="concept-fe-checked">checkedness</a> to the new value and
                   1039:   set the element's <a href="the-input-element.html#concept-input-checked-dirty-flag" title="concept-input-checked-dirty-flag">dirty checkedness
                   1040:   flag</a> to true.</p>
                   1041: 
                   1042:   <hr><p>The <dfn id="dom-input-files" title="dom-input-files"><code>files</code></dfn> IDL
                   1043:   attribute allows scripts to access the element's <a href="number-state.html#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>. On
                   1044:   getting, if the IDL attribute applies, it must return a
                   1045:   <code>FileList</code> object that represents the current <a href="number-state.html#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>. The
                   1046:   same object must be returned until the list of <a href="number-state.html#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>
                   1047:   changes. If the IDL attribute does not apply, then it must instead
1.7       mike     1048:   return null. <a href="references.html#refsFILEAPI">[FILEAPI]</a></p>
1.1       mike     1049: 
                   1050:   <hr><p>The <dfn id="dom-input-valueasdate" title="dom-input-valueAsDate"><code>valueAsDate</code></dfn> IDL
                   1051:   attribute represents the <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> of the element, interpreted
                   1052:   as a date.</p>
                   1053: 
                   1054:   <p>On getting, if the <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code> attribute does not
                   1055:   apply, as defined for the <code><a href="the-input-element.html#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state, then
                   1056:   return null. Otherwise, run the <a href="the-input-element.html#concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
                   1057:   string to a <code>Date</code> object</a> defined for that state;
                   1058:   if the algorithm returned a <code>Date</code> object, then return
                   1059:   it, otherwise, return null.</p>
                   1060: 
                   1061:   <p>On setting, if the <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAsDate</a></code> attribute does not
                   1062:   apply, as defined for the <code><a href="the-input-element.html#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state, then
                   1063:   throw an <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception; otherwise, if
                   1064:   the new value is null, then set the <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> of the element to the empty
                   1065:   string; otherwise, run the <a href="the-input-element.html#concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
                   1066:   <code>Date</code> object to a string</a>, as defined for that
                   1067:   state, on the new value, and set the <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> of the element to resulting
                   1068:   string.</p>
                   1069: 
                   1070:   <hr><p>The <dfn id="dom-input-valueasnumber" title="dom-input-valueAsNumber"><code>valueAsNumber</code></dfn> IDL
                   1071:   attribute represents the <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>
                   1072:   of the element, interpreted as a number.</p>
                   1073: 
                   1074:   <p>On getting, if the <code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> attribute does
                   1075:   not apply, as defined for the <code><a href="the-input-element.html#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state, then
                   1076:   return a Not-a-Number (NaN) value. Otherwise, if the <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAs<em>Date</em></a></code>
                   1077:   attribute applies, run the <a href="the-input-element.html#concept-input-value-string-date" title="concept-input-value-string-date">algorithm to convert a
                   1078:   string to a <code>Date</code> object</a> defined for that state;
                   1079:   if the algorithm returned a <code>Date</code> object, then return
                   1080:   the <i>time value</i> of the object (the number of milliseconds from
                   1081:   midnight UTC the morning of 1970-01-01 to the time represented by
                   1082:   the <code>Date</code> object), otherwise, return a Not-a-Number
                   1083:   (NaN) value. Otherwise, run the <a href="the-input-element.html#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
                   1084:   string to a number</a> defined for that state; if the algorithm
                   1085:   returned a number, then return it, otherwise, return a Not-a-Number
                   1086:   (NaN) value.</p>
                   1087: 
                   1088:   <p>On setting, if the <code title="dom-input-valueAsNumber"><a href="#dom-input-valueasnumber">valueAsNumber</a></code> attribute does
                   1089:   not apply, as defined for the <code><a href="the-input-element.html#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state, then
                   1090:   throw an <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception. Otherwise, if
                   1091:   the <code title="dom-input-valueAsDate"><a href="#dom-input-valueasdate">valueAs<em>Date</em></a></code>
                   1092:   attribute applies, run the <a href="the-input-element.html#concept-input-value-date-string" title="concept-input-value-date-string">algorithm to convert a
                   1093:   <code>Date</code> object to a string</a> defined for that state,
                   1094:   passing it a <code>Date</code> object whose <i>time value</i> is the
                   1095:   new value, and set the <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>
                   1096:   of the element to resulting string. Otherwise, run the <a href="the-input-element.html#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
                   1097:   number to a string</a>, as defined for that state, on the new
                   1098:   value, and set the <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> of
                   1099:   the element to resulting string.</p>
                   1100: 
                   1101:   <hr><p>The <dfn id="dom-input-stepdown" title="dom-input-stepDown"><code>stepDown(<var title="">n</var>)</code></dfn> and <dfn id="dom-input-stepup" title="dom-input-stepUp"><code>stepUp(<var title="">n</var>)</code></dfn> methods, when invoked, must run the
                   1102:   following algorithm:</p>
                   1103: 
                   1104:   <ol><li><p>If the <code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> and
                   1105:    <code title="dom-input-stepUp"><a href="#dom-input-stepup">stepUp()</a></code> methods do not
                   1106:    apply, as defined for the <code><a href="the-input-element.html#the-input-element">input</a></code> element's <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's current state, then
                   1107:    throw an <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception, and abort these
                   1108:    steps.</p></li>
                   1109: 
                   1110:    <li><p>If the element has no <a href="#concept-input-step" title="concept-input-step">allowed value step</a>, then throw an
                   1111:    <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception, and abort these
                   1112:    steps.</p></li>
                   1113: 
                   1114:    <li><p>If applying the <a href="the-input-element.html#concept-input-value-string-number" title="concept-input-value-string-number">algorithm to convert a
                   1115:    string to a number</a> to the string given by the element's
                   1116:    <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> results in an error,
                   1117:    then throw an <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception, and abort
                   1118:    these steps; otherwise, let <var title="">value</var> be the result
                   1119:    of that algorithm.</p></li>
                   1120: 
                   1121:    <li><p>Let <var title="">n</var> be the argument, or 1 if the
                   1122:    argument was omitted.</p></li>
                   1123: 
                   1124:    <li><p>Let <var title="">delta</var> be the <a href="#concept-input-step" title="concept-input-step">allowed value step</a> multiplied by
                   1125:    <var title="">n</var>.</p></li>
                   1126: 
                   1127:    <li><p>If the method invoked was the <code title="dom-input-stepDown"><a href="#dom-input-stepdown">stepDown()</a></code> method, negate <var title="">delta</var>.</p></li>
                   1128: 
                   1129:    <li><p>Let <var title="">value</var> be the result of adding <var title="">delta</var> to <var title="">value</var>.</p></li>
                   1130:    <li><p>If the element has a <a href="#concept-input-min" title="concept-input-min">minimum</a>, and the <var title="">value</var> is less than that <a href="#concept-input-min" title="concept-input-min">minimum</a>, then throw a
                   1131:    <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception.</p></li>
                   1132: 
                   1133:    <li><p>If the element has a <a href="#concept-input-max" title="concept-input-max">maximum</a>, and the <var title="">value</var> is greater than that <a href="#concept-input-max" title="concept-input-max">maximum</a>, then throw a
                   1134:    <code><a href="common-dom-interfaces.html#invalid_state_err">INVALID_STATE_ERR</a></code> exception.</p></li>
                   1135: 
                   1136:    <li><p>Let <var title="">value as string</var> be the result of
                   1137:    running the <a href="the-input-element.html#concept-input-value-number-string" title="concept-input-value-number-string">algorithm to convert a
                   1138:    number to a string</a>, as defined for the <code><a href="the-input-element.html#the-input-element">input</a></code>
                   1139:    element's <code title="attr-input-type"><a href="the-input-element.html#attr-input-type">type</a></code> attribute's
                   1140:    current state, on <var title="">value</var>.</p></li>
                   1141: 
                   1142:    <li><p>Set the <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> of the
                   1143:    element to <var title="">value as string</var>.</p></li>
                   1144: 
                   1145:   </ol><hr><p>The <dfn id="dom-input-list" title="dom-input-list"><code>list</code></dfn> IDL
                   1146:   attribute must return the current <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>, if
                   1147:   any, or null otherwise.</p>
                   1148: 
                   1149:   <p>The <dfn id="dom-input-selectedoption" title="dom-input-selectedOption"><code>selectedOption</code></dfn>
                   1150:   IDL attribute must return the first <code><a href="the-button-element.html#the-option-element">option</a></code> element, in
                   1151:   <a href="infrastructure.html#tree-order">tree order</a>, to be a child of the <a href="#concept-input-list" title="concept-input-list">suggestions source element</a> and
                   1152:   whose <a href="the-button-element.html#concept-option-value" title="concept-option-value">value</a> matches the
                   1153:   <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a>, if any. If there is no <a href="#concept-input-list" title="concept-input-list">suggestions source element</a>, or if
                   1154:   it contains no matching <code><a href="the-button-element.html#the-option-element">option</a></code> element, then the <code title="dom-input-selectedOption"><a href="#dom-input-selectedoption">selectedOption</a></code> attribute
                   1155:   must return null.</p>
                   1156: 
                   1157:   </div><div class="impl">
                   1158: 
1.14      mike     1159:   <h5 id="common-event-behaviors"><span class="secno">4.10.7.4 </span>Common event behaviors</h5>
1.1       mike     1160: 
                   1161:   <p>When the <dfn id="event-input-input" title="event-input-input"><code>input</code></dfn>
                   1162:   event applies, any time the user causes the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> to change, the user agent must
                   1163:   <a href="webappapis.html#queue-a-task">queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple event</a> that
                   1164:   bubbles named <code title="event-input">input</code> at the
                   1165:   <code><a href="the-input-element.html#the-input-element">input</a></code> element, then <a href="association-of-controls-and-forms.html#broadcast-forminput-events">broadcast <code title="event-forminput">forminput</code> events</a> at the
                   1166:   <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="association-of-controls-and-forms.html#form-owner">form owner</a>. User agents
                   1167:   may wait for a suitable break in the user's interaction before
                   1168:   queuing the task; for example, a user agent could wait for the user
                   1169:   to have not hit a key for 100ms, so as to only fire the event when
                   1170:   the user pauses, instead of continuously for each keystroke.</p>
                   1171:   <!-- same text is present in the <textarea> section -->
                   1172: 
                   1173:   <p class="example">Examples of a user changing the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> would include the user typing
                   1174:   into a text field, pasting a new value into the field, or undoing an
                   1175:   edit in that field. Some user interactions do not cause changes to
                   1176:   the value, e.g. hitting the "delete" key in an empty text field, or
                   1177:   replacing some text in the field with text from the clipboard that
                   1178:   happens to be exactly the same text.</p>
                   1179: 
                   1180:   <p>When the <dfn id="event-input-change" title="event-input-change"><code>change</code></dfn> event applies,
                   1181:   if the element does not have an <a href="content-models.html#activation-behavior">activation behavior</a>
                   1182:   defined but uses a user interface that involves an explicit commit
                   1183:   action, then any time the user commits a change to the element's
                   1184:   <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> or list of <a href="number-state.html#concept-input-type-file-selected" title="concept-input-type-file-selected">selected files</a>, the
                   1185:   user agent must <a href="webappapis.html#queue-a-task">queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple
                   1186:   event</a> that bubbles named <code title="event-change">change</code> at the <code><a href="the-input-element.html#the-input-element">input</a></code>
                   1187:   element, then <a href="association-of-controls-and-forms.html#broadcast-formchange-events">broadcast <code title="event-formchange">formchange</code> events</a> at the
                   1188:   <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="association-of-controls-and-forms.html#form-owner">form owner</a>.</p>
                   1189: 
                   1190:   <p class="example">An example of a user interface with a commit
                   1191:   action would be a <a href="number-state.html#file-upload-state" title="attr-input-type-file">File
                   1192:   Upload</a> control that consists of a single button that brings
                   1193:   up a file selection dialog: when the dialog is closed, if that the
                   1194:   <a href="number-state.html#concept-input-type-file-selected" title="concept-input-type-file-selected">file selection</a>
                   1195:   changed as a result, then the user has committed a new <a href="number-state.html#concept-input-type-file-selected" title="concept-input-type-file-selected">file selection</a>.</p>
                   1196: 
                   1197:   <p class="example">Another example of a user interface with a commit
                   1198:   action would be a <a href="states-of-the-type-attribute.html#date-state" title="attr-input-type-date">Date</a>
                   1199:   control that allows both text-based user input and user selection
                   1200:   from a drop-down calendar: while text input might not have an
                   1201:   explicit commit step, selecting a date from the drop down calendar
                   1202:   and then dismissing the drop down would be a commit action.</p>
                   1203: 
                   1204:   <p>When the user agent changes the element's <a href="association-of-controls-and-forms.html#concept-fe-value" title="concept-fe-value">value</a> on behalf of the user (e.g. as
                   1205:   part of a form prefilling feature), the user agent must follow these
                   1206:   steps:</p>
                   1207: 
                   1208:   <ol><li>If the <code title="event-input-input"><a href="#event-input-input">input</a></code> event
                   1209:    applies, <a href="webappapis.html#queue-a-task">queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple
                   1210:    event</a> that bubbles named <code title="event-input">input</code> at the <code><a href="the-input-element.html#the-input-element">input</a></code>
                   1211:    element.</li>
                   1212: 
                   1213:    <li>If the <code title="event-input-input"><a href="#event-input-input">input</a></code> event
                   1214:    applies, <a href="association-of-controls-and-forms.html#broadcast-forminput-events">broadcast <code title="event-forminput">forminput</code> events</a> at the
                   1215:    <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="association-of-controls-and-forms.html#form-owner">form owner</a>.</li>
                   1216: 
                   1217:    <li>If the <code title="event-input-change"><a href="#event-input-change">change</a></code> event
                   1218:    applies, <a href="webappapis.html#queue-a-task">queue a task</a> to <a href="webappapis.html#fire-a-simple-event">fire a simple
                   1219:    event</a> that bubbles named <code title="event-change">change</code> at the <code><a href="the-input-element.html#the-input-element">input</a></code>
                   1220:    element.</li>
                   1221: 
                   1222:    <li>If the <code title="event-input-change"><a href="#event-input-change">change</a></code> event
                   1223:    applies, <a href="association-of-controls-and-forms.html#broadcast-formchange-events">broadcast <code title="event-formchange">formchange</code> events</a> at the
                   1224:    <code><a href="the-input-element.html#the-input-element">input</a></code> element's <a href="association-of-controls-and-forms.html#form-owner">form owner</a>.</li>
                   1225: 
                   1226:   </ol><p class="note">In addition, when the <code title="event-input-change"><a href="#event-input-change">change</a></code> event applies, <code title="event-change">change</code> events can also be fired as part
                   1227:   of the element's <a href="content-models.html#activation-behavior">activation behavior</a> and as part of the
                   1228:   <a href="editing.html#unfocusing-steps">unfocusing steps</a>.</p>
                   1229: 
                   1230:   <p>The <a href="webappapis.html#task-source">task source</a> for these <a href="webappapis.html#concept-task" title="concept-task">tasks</a> is the <a href="webappapis.html#user-interaction-task-source">user interaction task
                   1231:   source</a>.</p>
                   1232: 
                   1233:   </div></body></html>

Webmaster