Annotation of html5/spec-author-view/the-button-element.html, revision 1.359

1.354     mike        1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><!-- when publishing, change bits marked ZZZ
                      2:      ZZZ: Set PUB to 1 for TR/ drafts, 0 for dev drafts; PUB-Y lines are used if it's 1 and PUB-N lines if it's 0.
                      3:      ZZZ: Set YEAR, SHORTDAY (month/day), and LONGDAY accordingly. They are used by the INSERT FOO bits below.
                      4:   --><html class="split chapter" lang="en-US-x-Hixie"><meta content="text/html; charset=ascii" http-equiv="Content-Type"><title>4.10.8 The button element &mdash; HTML5 (Edition for Web Authors)</title><meta content="width=device-width;" name="viewport"><meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"><link href="whatwg.css" rel="stylesheet"><style type="text/css">
1.1       mike        5:    pre { margin-left: 2em; white-space: pre-wrap; }
                      6:    h2 { margin: 3em 0 1em 0; }
                      7:    h3 { margin: 2.5em 0 1em 0; }
                      8:    h4 { margin: 2.5em 0 0.75em 0; }
                      9:    h5, h6 { margin: 2.5em 0 1em; }
                     10:    h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
                     11:    h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
                     12:    p { margin: 1em 0; }
                     13:    hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
                     14:    dl, dd { margin-top: 0; margin-bottom: 0; }
                     15:    dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
                     16:    dt + dt { margin-top: 0; }
                     17:    dd dt { margin-top: 0.25em; margin-bottom: 0; }
                     18:    dd p { margin-top: 0; }
                     19:    dd dl + p { margin-top: 1em; }
                     20:    dd table + p { margin-top: 1em; }
                     21:    p + * > li, dd li { margin: 1em 0; }
                     22:    dt, dfn { font-weight: bold; font-style: normal; }
                     23:    dt dfn { font-style: italic; }
                     24:    pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
                     25:    pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
                     26:    pre em { font-weight: bolder; font-style: normal; }
                     27:    @media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
                     28:    var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
                     29:    table { border-collapse: collapse; border-style: hidden hidden none hidden; }
1.34      mike       30:    table thead, table tbody { border-bottom: solid; }
1.1       mike       31:    table tbody th:first-child { border-left: solid; }
                     32:    table tbody th { text-align: left; }
                     33:    table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
                     34:    blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }
                     35: 
                     36:    .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
                     37:    .matrix, .matrix td { border: none; text-align: right; }
                     38:    .matrix { margin-left: 2em; }
                     39:    .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
                     40:    .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
                     41:    .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
                     42: 
                     43:    .toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
                     44:    img.extra { float: right; }
                     45:    pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; }
                     46:    pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
                     47:    pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
                     48:    pre.css:first-line { color: #AAAA50; }
1.23      mike       49:    dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
1.1       mike       50:    hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
                     51:    dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
                     52:    dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
                     53:    dl.domintro dd p { margin: 0.5em 0; }
                     54:    dl.switch { padding-left: 2em; }
                     55:    dl.switch > dt { text-indent: -1.5em; }
                     56:    dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
                     57:    dl.triple { padding: 0 0 0 1em; }
                     58:    dl.triple dt, dl.triple dd { margin: 0; display: inline }
                     59:    dl.triple dt:after { content: ':'; }
                     60:    dl.triple dd:after { content: '\A'; white-space: pre; }
                     61:    .diff-old { text-decoration: line-through; color: silver; background: transparent; }
                     62:    .diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
                     63:    a .diff-new { border-bottom: 1px blue solid; }
                     64: 
                     65:    h2 { page-break-before: always; }
                     66:    h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
                     67:    h1 + h2, hr + h2.no-toc { page-break-before: auto; }
                     68: 
1.306     mike       69:    p  > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]),
                     70:    li > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]), { border-bottom: solid #9999CC; }
1.1       mike       71: 
                     72:    div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
                     73:    div.head p { margin: 0; }
                     74:    div.head h1 { margin: 0; }
                     75:    div.head .logo { float: right; margin: 0 1em; }
                     76:    div.head .logo img { border: none } /* remove border from top image */
                     77:    div.head dl { margin: 1em 0; }
                     78:    div.head p.copyright, div.head p.alt { font-size: x-small; font-style: oblique; margin: 0; }
                     79: 
                     80:    body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
                     81:    body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
                     82:    body > .toc > li > * { margin-bottom: 0.5em; }
                     83:    body > .toc > li > * > li > * { margin-bottom: 0.25em; }
                     84:    .toc, .toc li { list-style: none; }
                     85: 
                     86:    .brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
                     87:    .brief li { margin: 0; padding: 0; }
                     88:    .brief li p { margin: 0; padding: 0; }
                     89: 
                     90:    .category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
                     91:    .category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
                     92:    .category-list li { display: inline; }
                     93:    .category-list li:not(:last-child)::after { content: ', '; }
                     94:    .category-list li > span, .category-list li > a { text-transform: lowercase; }
                     95:    .category-list li * { text-transform: none; } /* don't affect <code> nested in <a> */
                     96: 
                     97:    .XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
                     98:    .XXX > :first-child { margin-top: 0; }
                     99:    p .XXX { line-height: 3em; }
                    100:    .annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
                    101:    .annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
                    102:    .annotation :link, .annotation :visited { color: inherit; }
                    103:    .annotation :link:hover, .annotation :visited:hover { background: transparent; }
                    104:    .annotation span { border: none ! important; }
                    105:    .note { color: green; background: transparent; font-family: sans-serif; }
                    106:    .warning { color: red; background: transparent; }
                    107:    .note, .warning { font-weight: bolder; font-style: italic; }
                    108:    p.note, div.note { padding: 0.5em 2em; }
                    109:    span.note { padding: 0 2em; }
                    110:    .note p:first-child, .warning p:first-child { margin-top: 0; }
                    111:    .note p:last-child, .warning p:last-child { margin-bottom: 0; }
                    112:    .warning:before { font-style: normal; }
                    113:    p.note:before { content: 'Note: '; }
                    114:    p.warning:before { content: '\26A0 Warning! '; }
                    115: 
                    116:    .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
                    117:    .bookkeeping { font-size: 0.8em; margin: 2em 0; }
                    118:    .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }
1.132     mike      119:    .bookkeeping dt { margin: 0.5em 2em 0; }
                    120:    .bookkeeping dd { margin: 0 3em 0.5em; }
1.1       mike      121: 
                    122:    h4 { position: relative; z-index: 3; }
                    123:    h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
                    124:    .element {
                    125:      background: #EEEEFF;
                    126:      color: black;
                    127:      margin: 0 0 1em 0.15em;
                    128:      padding: 0 1em 0.25em 0.75em;
                    129:      border-left: solid #9999FF 0.25em;
                    130:      position: relative;
                    131:      z-index: 1;
                    132:    }
                    133:    .element:before {
                    134:      position: absolute;
                    135:      z-index: 2;
                    136:      top: 0;
                    137:      left: -1.15em;
                    138:      height: 2em;
                    139:      width: 0.9em;
                    140:      background: #EEEEFF;
                    141:      content: ' ';
                    142:      border-style: none none solid solid;
                    143:      border-color: #9999FF;
                    144:      border-width: 0.25em;
                    145:    }
                    146: 
                    147:    .example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; }
                    148:    td > .example:only-child { margin: 0 0 0 0.1em; }
                    149: 
                    150:    ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
                    151:    ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
                    152:    ul.domTree li li { list-style: none; }
                    153:    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; }
                    154:    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; }
                    155:    ul.domTree span { font-style: italic; font-family: serif; }
                    156:    ul.domTree .t1 code { color: purple; font-weight: bold; }
                    157:    ul.domTree .t2 { font-style: normal; font-family: monospace; }
                    158:    ul.domTree .t2 .name { color: black; font-weight: bold; }
                    159:    ul.domTree .t2 .value { color: blue; font-weight: normal; }
                    160:    ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
                    161:    ul.domTree .t7 code, .domTree .t8 code { color: green; }
                    162:    ul.domTree .t10 code { color: teal; }
                    163: 
1.14      mike      164:    body.dfnEnabled dfn { cursor: pointer; }
                    165:    .dfnPanel {
                    166:      display: inline;
                    167:      position: absolute;
                    168:      z-index: 10;
                    169:      height: auto;
                    170:      width: auto;
                    171:      padding: 0.5em 0.75em;
                    172:      font: small sans-serif, Droid Sans Fallback;
                    173:      background: #DDDDDD;
                    174:      color: black;
                    175:      border: outset 0.2em;
                    176:    }
                    177:    .dfnPanel * { margin: 0; padding: 0; font: inherit; text-indent: 0; }
                    178:    .dfnPanel :link, .dfnPanel :visited { color: black; }
                    179:    .dfnPanel p { font-weight: bolder; }
                    180:    .dfnPanel * + p { margin-top: 0.25em; }
                    181:    .dfnPanel li { list-style-position: inside; }
                    182: 
1.1       mike      183:    #configUI { position: absolute; z-index: 20; top: 10em; right: 1em; width: 11em; font-size: small; }
                    184:    #configUI p { margin: 0.5em 0; padding: 0.3em; background: #EEEEEE; color: black; border: inset thin; }
                    185:    #configUI p label { display: block; }
                    186:    #configUI #updateUI, #configUI .loginUI { text-align: center; }
                    187:    #configUI input[type=button] { display: block; margin: auto; }
1.121     mike      188: 
1.321     mike      189:    fieldset { margin: 1em; padding: 0.5em 1em; }
                    190:    fieldset > legend + * { margin-top: 0; }
1.293     mike      191:    fieldset > :last-child { margin-bottom: 0; }
1.321     mike      192:    fieldset p { margin: 0.5em 0; }
                    193: 
                    194:    .stability {
                    195:      position: fixed;
                    196:      bottom: 0;
                    197:      left: 0; right: 0;
                    198:      margin: 0 auto 0 auto;
                    199:      width: 50%;
                    200:      background: maroon; color: yellow;
                    201:      -webkit-border-radius: 1em 1em 0 0;
                    202:      -moz-border-radius: 1em 1em 0 0;
                    203:      border-radius: 1em 1em 0 0;
                    204:      -moz-box-shadow: 0 0 1em #500;
                    205:      -webkit-box-shadow: 0 0 1em #500;
                    206:      box-shadow: 0 0 1em red;
                    207:      padding: 0.5em 1em;
                    208:      text-align: center;
                    209:    }
                    210:    .stability strong {
                    211:      display: block;
                    212:    }
1.325     mike      213:    .stability input {
                    214:      appearance: none; margin: 0; border: 0; padding: 0.25em 0.5em; background: transparent; color: black;
                    215:      position: absolute; top: -0.5em; right: 0; font: 1.25em sans-serif; text-align: center;
                    216:    }
                    217:    .stability input:hover {
                    218:      color: white;
                    219:      text-shadow: 0 0 2px black;
                    220:    }
                    221:    .stability input:active {
                    222:      padding: 0.3em 0.45em 0.2em 0.55em;
                    223:    }
1.321     mike      224:    .stability :link, .stability :visited,
                    225:    .stability :link:hover, .stability :visited:hover {
                    226:      background: transparent;
                    227:      color: white;
                    228:    }
1.293     mike      229: 
1.354     mike      230:   </style><link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet" type="text/css"><link href="style.css" rel="stylesheet"><script src="link-fixup.js"></script><style type="text/css">
1.1       mike      231: 
                    232:    .applies thead th > * { display: block; }
                    233:    .applies thead code { display: block; }
                    234:    .applies tbody th { whitespace: nowrap; }
                    235:    .applies td { text-align: center; }
                    236:    .applies .yes { background: yellow; }
                    237: 
1.136     mike      238:    .matrix, .matrix td { border: hidden; text-align: right; }
1.1       mike      239:    .matrix { margin-left: 2em; }
                    240: 
                    241:    .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
                    242:    .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
                    243:    .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
                    244: 
1.213     mike      245:    td.eg { border-width: thin; text-align: center; }
                    246: 
1.1       mike      247:    #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
                    248:    #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
                    249:    #table-example-1 caption { padding-bottom: 0.5em; }
                    250:    #table-example-1 thead, #table-example-1 tbody { border: none; }
                    251:    #table-example-1 th, #table-example-1 td { border: solid thin; }
                    252:    #table-example-1 th { font-weight: normal; }
                    253:    #table-example-1 td { border-style: none solid; vertical-align: top; }
                    254:    #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
                    255:    #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
                    256:    #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
                    257:    #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
                    258:    #table-example-1 tbody td:first-child::after { content: leader(". "); }
                    259:    #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
                    260:    #table-example-1 tbody td:first-child + td { width: 10em; }
                    261:    #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
                    262:    #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
                    263: 
                    264:    .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
                    265:    .apple-table-examples * { font-family: "Times", serif; }
                    266:    .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
                    267:    .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
                    268:    .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
                    269:    .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
                    270:    .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
                    271:    .apple-table-examples td { text-align: right; vertical-align: top; }
                    272:    .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
1.9       mike      273:    .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
                    274:    .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
                    275:    .apple-table-examples sup { line-height: 0; }
                    276: 
1.11      mike      277:    .details-example img { vertical-align: top; }
                    278: 
1.26      mike      279:    #named-character-references-table {
1.257     mike      280:      white-space: nowrap;
1.26      mike      281:      font-size: 0.6em;
1.257     mike      282:      column-width: 30em;
1.26      mike      283:      column-gap: 1em;
1.257     mike      284:      -moz-column-width: 30em;
1.26      mike      285:      -moz-column-gap: 1em;
1.257     mike      286:      -webkit-column-width: 30em;
1.26      mike      287:      -webkit-column-gap: 1em;
                    288:    }
1.257     mike      289:    #named-character-references-table > table > tbody > tr > td:first-child + td,
1.26      mike      290:    #named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
                    291:    #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.257     mike      292:    #named-character-references-table > table > tbody > tr#entity-CounterClockwiseContourIntegral > td:first-child { font-size: 0.5em; }
1.26      mike      293: 
1.35      mike      294:    .glyph.control { color: red; }
                    295: 
1.38      mike      296:    @font-face {
                    297:      font-family: 'Essays1743';
                    298:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743.ttf');
                    299:    }
                    300:    @font-face {
                    301:      font-family: 'Essays1743';
                    302:      font-weight: bold;
                    303:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Bold.ttf');
                    304:    }
                    305:    @font-face {
                    306:      font-family: 'Essays1743';
                    307:      font-style: italic;
                    308:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Italic.ttf');
                    309:    }
                    310:    @font-face {
                    311:      font-family: 'Essays1743';
                    312:      font-style: italic;
                    313:      font-weight: bold;
                    314:      src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-BoldItalic.ttf');
                    315:    }
                    316: 
1.25      mike      317:   </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">
1.157     mike      318:  function getCookie(name) {
                    319:    var params = location.search.substr(1).split("&");
                    320:    for (var index = 0; index < params.length; index++) {
                    321:      if (params[index] == name)
                    322:        return "1";
                    323:      var data = params[index].split("=");
                    324:      if (data[0] == name)
                    325:        return unescape(data[1]);
1.9       mike      326:    }
1.157     mike      327:    var cookies = document.cookie.split("; ");
                    328:    for (var index = 0; index < cookies.length; index++) {
                    329:      var data = cookies[index].split("=");
                    330:      if (data[0] == name)
                    331:        return unescape(data[1]);
1.9       mike      332:    }
1.157     mike      333:    return null;
                    334:  }
                    335:  function load(script) {
                    336:    var e = document.createElement('script');
                    337:    e.setAttribute('src', script + '?' + encodeURIComponent(location) + '&' + encodeURIComponent(document.referrer));
                    338:    document.body.appendChild(e);
                    339:  }
                    340:  function init() {
                    341:    if (location.search == '?slow-browser')
                    342:      return;
                    343:    var configUI = document.createElement('div');
                    344:    configUI.id = 'configUI';
                    345:    document.body.appendChild(configUI);
                    346:    if (document.getElementById('head'))
                    347:      load('toc.js');
                    348:    load('dfn.js');
                    349:    if (getCookie('profile') == '1')
                    350:      document.getElementsByTagName('h2')[0].textContent += '; load: ' + (new Date() - loadTimer) + 'ms';
                    351:    fixBrokenLink();
                    352:  }
1.354     mike      353: </script><link href="common-input-element-attributes.html" rel="prev" title="4.10.7.2 Common input element attributes">
1.160     mike      354:   <link href="Overview.html#contents" rel="index" title="Table of contents">
                    355:   <link href="association-of-controls-and-forms.html" rel="next" title="4.10.18 Association of controls and forms">
                    356:   <body onload="fixBrokenLink(); init()"><div class="head" id="head">
1.9       mike      357:    <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.36      mike      358: 
1.359   ! mike      359:    <h1>HTML5 <span class="edition">Edition for Web Authors</span> <span class="rcsrevision">revision 1.4589</span></h1>
1.9       mike      360:    </div><div>
1.320     mike      361:    <a href="common-input-element-attributes.html">&larr; 4.10.7.2 Common input element attributes</a> &ndash;
1.160     mike      362:    <a href="Overview.html#contents">Table of contents</a> &ndash;
1.320     mike      363:    <a href="association-of-controls-and-forms.html">4.10.18 Association of controls and forms &rarr;</a>
1.160     mike      364:   <ol class="toc"><li><ol><li><ol><li><a href="the-button-element.html#the-button-element" id="x4.10.8-the-button-element"><span class="secno">4.10.8 </span>The <code>button</code> element</a><li><a href="the-button-element.html#the-select-element" id="x4.10.9-the-select-element"><span class="secno">4.10.9 </span>The <code>select</code> element</a><li><a href="the-button-element.html#the-datalist-element" id="x4.10.10-the-datalist-element"><span class="secno">4.10.10 </span>The <code>datalist</code> element</a><li><a href="the-button-element.html#the-optgroup-element" id="x4.10.11-the-optgroup-element"><span class="secno">4.10.11 </span>The <code>optgroup</code> element</a><li><a href="the-button-element.html#the-option-element" id="x4.10.12-the-option-element"><span class="secno">4.10.12 </span>The <code>option</code> element</a><li><a href="the-button-element.html#the-textarea-element" id="x4.10.13-the-textarea-element"><span class="secno">4.10.13 </span>The <code>textarea</code> element</a><li><a href="the-button-element.html#the-keygen-element" id="x4.10.14-the-keygen-element"><span class="secno">4.10.14 </span>The <code>keygen</code> element</a><li><a href="the-button-element.html#the-output-element" id="x4.10.15-the-output-element"><span class="secno">4.10.15 </span>The <code>output</code> element</a><li><a href="the-button-element.html#the-progress-element" id="x4.10.16-the-progress-element"><span class="secno">4.10.16 </span>The <code>progress</code> element</a><li><a href="the-button-element.html#the-meter-element" id="x4.10.17-the-meter-element"><span class="secno">4.10.17 </span>The <code>meter</code> element</a></ol></ol></ol></div>
1.156     mike      365: 
1.202     mike      366:   <h4 id="the-button-element"><span class="secno">4.10.8 </span>The <dfn><code>button</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.321     mike      367:    <dd><a href="content-models.html#flow-content" id="flow-content-125">Flow content</a>.</dd>
                    368:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-133">Phrasing content</a>.</dd>
1.156     mike      369:    <dd><a href="content-models.html#interactive-content" id="interactive-content-14">Interactive content</a>.</dd>
1.202     mike      370:    <dd><a href="forms.html#category-listed" id="category-listed-5" title="category-listed">Listed</a>, <a href="forms.html#category-label" id="category-label-3" title="category-label">labelable</a>, and <a href="forms.html#category-submit" id="category-submit-4" title="category-submit">submittable</a> <a href="forms.html#form-associated-element" id="form-associated-element-9">form-associated element</a>.</dd>
1.203     mike      371:    <dt>Contexts in which this element can be used:</dt>
1.321     mike      372:    <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content-134">phrasing content</a> is expected.</dd>
1.9       mike      373:    <dt>Content model:</dt>
1.321     mike      374:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-135">Phrasing content</a>, but there must be no <a href="content-models.html#interactive-content" id="interactive-content-15">interactive content</a> descendant.</dd>
1.9       mike      375:    <dt>Content attributes:</dt>
1.321     mike      376:    <dd><a href="elements.html#global-attributes" id="global-attributes-88">Global attributes</a></dd>
1.156     mike      377:    <dd><code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus-1">autofocus</a></code></dd>
                    378:    <dd><code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled-12">disabled</a></code></dd>
1.262     mike      379:    <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-49">form</a></code></dd>
1.156     mike      380:    <dd><code title="attr-fs-formaction"><a href="association-of-controls-and-forms.html#attr-fs-formaction" id="formaction-26">formaction</a></code></dd>
                    381:    <dd><code title="attr-fs-formenctype"><a href="association-of-controls-and-forms.html#attr-fs-formenctype" id="formenctype-26">formenctype</a></code></dd>
                    382:    <dd><code title="attr-fs-formmethod"><a href="association-of-controls-and-forms.html#attr-fs-formmethod" id="formmethod-26">formmethod</a></code></dd>
                    383:    <dd><code title="attr-fs-formnovalidate"><a href="association-of-controls-and-forms.html#attr-fs-formnovalidate" id="formnovalidate-27">formnovalidate</a></code></dd>
                    384:    <dd><code title="attr-fs-formtarget"><a href="association-of-controls-and-forms.html#attr-fs-formtarget" id="formtarget-26">formtarget</a></code></dd>
                    385:    <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-37">name</a></code></dd>
1.213     mike      386:    <dd><code title="attr-button-type"><a href="#attr-button-type" id="type-75">type</a></code></dd>
1.255     mike      387:    <dd><code title="attr-button-value"><a href="#attr-button-value" id="value-30">value</a></code></dd>
1.9       mike      388:    <dt>DOM interface:</dt>
                    389:    <dd>
1.321     mike      390: <pre class="idl">interface <dfn id="htmlbuttonelement">HTMLButtonElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-96">HTMLElement</a> {
1.162     mike      391:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-autofocus" title='Read about this "autofocus" reference in the full HTML5 spec.'>autofocus</a>;
                    392:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-disabled" title='Read about this "disabled" reference in the full HTML5 spec.'>disabled</a>;
                    393:   readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement-5">HTMLFormElement</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fae-form" title='Read about this "form" reference in the full HTML5 spec.'>form</a>;
                    394:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fs-formaction" title='Read about this "formAction" reference in the full HTML5 spec.'>formAction</a>;
                    395:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fs-formenctype" title='Read about this "formEnctype" reference in the full HTML5 spec.'>formEnctype</a>;
                    396:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fs-formmethod" title='Read about this "formMethod" reference in the full HTML5 spec.'>formMethod</a>;
                    397:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fs-formnovalidate" title='Read about this "formNoValidate" reference in the full HTML5 spec.'>formNoValidate</a>;
                    398:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fs-formtarget" title='Read about this "formTarget" reference in the full HTML5 spec.'>formTarget</a>;
                    399:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-name" title='Read about this "name" reference in the full HTML5 spec.'>name</a>;
                    400:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-button-type" title='Read about this "type" reference in the full HTML5 spec.'>type</a>;
                    401:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-button-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a>;
                    402: 
                    403:   readonly attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-willvalidate" title='Read about this "willValidate" reference in the full HTML5 spec.'>willValidate</a>;
                    404:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#validitystate" title='Read about this "ValidityState" reference in the full HTML5 spec.'>ValidityState</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validity" title='Read about this "validity" reference in the full HTML5 spec.'>validity</a>;
                    405:   readonly attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validationmessage" title='Read about this "validationMessage" reference in the full HTML5 spec.'>validationMessage</a>;
                    406:   boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-checkvalidatity" title='Read about this "checkValidity" reference in the full HTML5 spec.'>checkValidity</a>();
                    407:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title='Read about this "setCustomValidity" reference in the full HTML5 spec.'>setCustomValidity</a>(in DOMString error);
1.9       mike      408: 
1.162     mike      409:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#nodelist" title='Read about this "NodeList" reference in the full HTML5 spec.'>NodeList</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/forms.html#dom-lfe-labels" title='Read about this "labels" reference in the full HTML5 spec.'>labels</a>;
1.9       mike      410: };</pre>
                    411:    </dd>
1.162     mike      412:   </dl><p>The <code><a href="#the-button-element" id="button-11">button</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a
1.160     mike      413:   button. <p>The element is a <a href="forms.html#concept-button" id="concept-button-4" title="concept-button">button</a>.<p>The <dfn id="attr-button-type" title="attr-button-type"><code>type</code></dfn>
1.9       mike      414:   attribute controls the behavior of the button when it is activated.
1.304     mike      415:   It is an <a href="common-microsyntaxes.html#enumerated-attribute" id="enumerated-attribute-9">enumerated attribute</a>. The following table
1.160     mike      416:   lists the keywords and states for the attribute &mdash; the keywords
1.9       mike      417:   in the left column map to the states in the cell in the second
1.160     mike      418:   column on the same row as the keyword.<table><thead><tr><th> Keyword
                    419:      <th> State
                    420:      <th> Brief description
                    421:    <tbody><tr><td><dfn id="attr-button-type-submit" title="attr-button-type-submit"><code>submit</code></dfn>
1.162     mike      422:      <td><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#attr-button-type-submit-state" title='Read about this "Submit Button" reference in the full HTML5 spec.'>Submit Button</a>
1.160     mike      423:      <td>Submits the form.
                    424:     <tr><td><dfn id="attr-button-type-reset" title="attr-button-type-reset"><code>reset</code></dfn>
1.162     mike      425:      <td><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#attr-button-type-reset-state" title='Read about this "Reset Button" reference in the full HTML5 spec.'>Reset Button</a>
1.160     mike      426:      <td>Resets the form.
                    427:     <tr><td><dfn id="attr-button-type-button" title="attr-button-type-button"><code>button</code></dfn>
1.162     mike      428:      <td><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#attr-button-type-button-state" title='Read about this "Button" reference in the full HTML5 spec.'>Button</a>
1.160     mike      429:      <td>Does nothing.
1.162     mike      430:   </table><p>The <i>missing value default</i> is the <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#attr-button-type-submit-state" title='Read about this "Submit Button" reference in the full HTML5 spec.'>Submit Button</a>
1.213     mike      431:   state.<p>If the <code title="attr-button-type"><a href="#attr-button-type" id="type-76">type</a></code> attribute is in
1.162     mike      432:   the <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#attr-button-type-submit-state" title='Read about this "Submit Button" reference in the full HTML5 spec.'>Submit Button</a>
1.262     mike      433:   state, the element is specifically a <a href="forms.html#concept-submit-button" id="concept-submit-button-2" title="concept-submit-button">submit button</a>.<p>The <code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-50">form</a></code> attribute is used to
1.156     mike      434:   explicitly associate the <code><a href="#the-button-element" id="button-12">button</a></code> element with its
                    435:   <a href="association-of-controls-and-forms.html#form-owner" id="form-owner-8">form owner</a>. The <code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-38">name</a></code>
                    436:   attribute represents the element's name. The <code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled-13">disabled</a></code> attribute is used to make
1.9       mike      437:   the control non-interactive and to prevent its value from being
1.156     mike      438:   submitted. The <code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus-2">autofocus</a></code>
                    439:   attribute controls focus. The <code title="attr-fs-formaction"><a href="association-of-controls-and-forms.html#attr-fs-formaction" id="formaction-27">formaction</a></code>, <code title="attr-fs-formenctype"><a href="association-of-controls-and-forms.html#attr-fs-formenctype" id="formenctype-27">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="association-of-controls-and-forms.html#attr-fs-formmethod" id="formmethod-27">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="association-of-controls-and-forms.html#attr-fs-formnovalidate" id="formnovalidate-28">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="association-of-controls-and-forms.html#attr-fs-formtarget" id="formtarget-27">formtarget</a></code> attributes are
1.160     mike      440:   <a href="association-of-controls-and-forms.html#attributes-for-form-submission" id="attributes-for-form-submission-3">attributes for form submission</a>.<p class="note">The <code title="attr-fs-formnovalidate"><a href="association-of-controls-and-forms.html#attr-fs-formnovalidate" id="formnovalidate-29">formnovalidate</a></code> attribute can
1.9       mike      441:   be used to make submit buttons that do not trigger the constraint
1.160     mike      442:   validation.<p>The <code title="attr-fs-formaction"><a href="association-of-controls-and-forms.html#attr-fs-formaction" id="formaction-28">formaction</a></code>, <code title="attr-fs-formenctype"><a href="association-of-controls-and-forms.html#attr-fs-formenctype" id="formenctype-28">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="association-of-controls-and-forms.html#attr-fs-formmethod" id="formmethod-28">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="association-of-controls-and-forms.html#attr-fs-formnovalidate" id="formnovalidate-30">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="association-of-controls-and-forms.html#attr-fs-formtarget" id="formtarget-28">formtarget</a></code> must not be specified
1.213     mike      443:   if the element's <code title="attr-button-type"><a href="#attr-button-type" id="type-77">type</a></code>
1.162     mike      444:   attribute is not in the <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#attr-button-type-submit-state" title='Read about this "Submit Button" reference in the full HTML5 spec.'>Submit Button</a>
1.160     mike      445:   state.<p>The <dfn id="attr-button-value" title="attr-button-value"><code>value</code></dfn>
1.9       mike      446:   attribute gives the element's value for the purposes of form
1.162     mike      447:   submission. The element's <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#concept-fe-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a> is the value of the element's
1.255     mike      448:   <code title="attr-button-value"><a href="#attr-button-value" id="value-31">value</a></code> attribute, if there is
1.160     mike      449:   one, or the empty string otherwise.<p class="note">A button (and its value) is only included in the
1.9       mike      450:   form submission if the button itself was used to initiate the form
1.160     mike      451:   submission.<div class="example">
1.9       mike      452: 
                    453:    <p>The following button is labeled "Show hint" and pops up a dialog
                    454:    box when activated:</p>
                    455: 
                    456:    <pre>&lt;button type=button
                    457:         onclick="alert('This 15-20 minute piece was composed by George Gershwin.')"&gt;
                    458:  Show hint
                    459: &lt;/button&gt;</pre>
                    460: 
1.202     mike      461:   </div><h4 id="the-select-element"><span class="secno">4.10.9 </span>The <dfn><code>select</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.321     mike      462:    <dd><a href="content-models.html#flow-content" id="flow-content-126">Flow content</a>.</dd>
                    463:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-136">Phrasing content</a>.</dd>
1.156     mike      464:    <dd><a href="content-models.html#interactive-content" id="interactive-content-16">Interactive content</a>.</dd>
1.202     mike      465:    <dd><a href="forms.html#category-listed" id="category-listed-6" title="category-listed">Listed</a>, <a href="forms.html#category-label" id="category-label-4" title="category-label">labelable</a>, <a href="forms.html#category-submit" id="category-submit-5" title="category-submit">submittable</a>, and <a href="forms.html#category-reset" id="category-reset-2" title="category-reset">resettable</a> <a href="forms.html#form-associated-element" id="form-associated-element-10">form-associated element</a>.</dd>
1.203     mike      466:    <dt>Contexts in which this element can be used:</dt>
1.321     mike      467:    <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content-137">phrasing content</a> is expected.</dd>
1.9       mike      468:    <dt>Content model:</dt>
1.191     mike      469:    <dd>Zero or more <code><a href="#the-option-element" id="option-9">option</a></code> or <code><a href="#the-optgroup-element" id="optgroup-3">optgroup</a></code> elements.</dd>
1.9       mike      470:    <dt>Content attributes:</dt>
1.321     mike      471:    <dd><a href="elements.html#global-attributes" id="global-attributes-89">Global attributes</a></dd>
1.156     mike      472:    <dd><code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus-3">autofocus</a></code></dd>
                    473:    <dd><code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled-14">disabled</a></code></dd>
1.262     mike      474:    <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-51">form</a></code></dd>
1.156     mike      475:    <dd><code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple-29">multiple</a></code></dd>
                    476:    <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-39">name</a></code></dd>
1.234     mike      477:    <dd><code title="attr-select-required"><a href="#attr-select-required" id="required-28">required</a></code></dd>
1.156     mike      478:    <dd><code title="attr-select-size"><a href="#attr-select-size" id="size-30">size</a></code></dd>
1.9       mike      479:    <dt>DOM interface:</dt>
                    480:    <dd>
1.321     mike      481: <pre class="idl">interface <dfn id="htmlselectelement">HTMLSelectElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-97">HTMLElement</a> {
1.162     mike      482:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-autofocus" title='Read about this "autofocus" reference in the full HTML5 spec.'>autofocus</a>;
                    483:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-disabled" title='Read about this "disabled" reference in the full HTML5 spec.'>disabled</a>;
                    484:   readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement-6">HTMLFormElement</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fae-form" title='Read about this "form" reference in the full HTML5 spec.'>form</a>;
                    485:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-multiple" title='Read about this "multiple" reference in the full HTML5 spec.'>multiple</a>;
                    486:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-name" title='Read about this "name" reference in the full HTML5 spec.'>name</a>;
1.165     mike      487:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-required" title='Read about this "required" reference in the full HTML5 spec.'>required</a>;
1.162     mike      488:            attribute unsigned long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-size" title='Read about this "size" reference in the full HTML5 spec.'>size</a>;
1.160     mike      489: 
1.162     mike      490:   readonly attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-type" title='Read about this "type" reference in the full HTML5 spec.'>type</a>;
1.160     mike      491: 
1.162     mike      492:   readonly attribute <a href="urls.html#htmloptionscollection" id="htmloptionscollection-3">HTMLOptionsCollection</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-options" title='Read about this "options" reference in the full HTML5 spec.'>options</a>;
                    493:            attribute unsigned long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-length" title='Read about this "length" reference in the full HTML5 spec.'>length</a>;
1.291     mike      494:   getter any <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-item" title='Read about this "item" reference in the full HTML5 spec.'>item</a>(in unsigned long index);
                    495:   any <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-nameditem" title='Read about this "namedItem" reference in the full HTML5 spec.'>namedItem</a>(in DOMString name);
1.321     mike      496:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-add" title='Read about this "add" reference in the full HTML5 spec.'>add</a>(in <a href="elements.html#htmlelement" id="htmlelement-98">HTMLElement</a> element, in optional <a href="elements.html#htmlelement" id="htmlelement-99">HTMLElement</a> before);
                    497:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-add" title='Read about this "add" reference in the full HTML5 spec.'>add</a>(in <a href="elements.html#htmlelement" id="htmlelement-100">HTMLElement</a> element, in long before);
1.162     mike      498:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-remove" title='Read about this "remove" reference in the full HTML5 spec.'>remove</a>(in long index);
                    499: 
1.202     mike      500:   readonly attribute <a href="urls.html#htmlcollection" id="htmlcollection-34">HTMLCollection</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-selectedoptions" title='Read about this "selectedOptions" reference in the full HTML5 spec.'>selectedOptions</a>;
1.162     mike      501:            attribute long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-selectedindex" title='Read about this "selectedIndex" reference in the full HTML5 spec.'>selectedIndex</a>;
                    502:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a>;
                    503: 
                    504:   readonly attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-willvalidate" title='Read about this "willValidate" reference in the full HTML5 spec.'>willValidate</a>;
                    505:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#validitystate" title='Read about this "ValidityState" reference in the full HTML5 spec.'>ValidityState</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validity" title='Read about this "validity" reference in the full HTML5 spec.'>validity</a>;
                    506:   readonly attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validationmessage" title='Read about this "validationMessage" reference in the full HTML5 spec.'>validationMessage</a>;
                    507:   boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-checkvalidatity" title='Read about this "checkValidity" reference in the full HTML5 spec.'>checkValidity</a>();
                    508:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title='Read about this "setCustomValidity" reference in the full HTML5 spec.'>setCustomValidity</a>(in DOMString error);
1.9       mike      509: 
1.162     mike      510:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#nodelist" title='Read about this "NodeList" reference in the full HTML5 spec.'>NodeList</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/forms.html#dom-lfe-labels" title='Read about this "labels" reference in the full HTML5 spec.'>labels</a>;
1.9       mike      511: };</pre>
                    512:    </dd>
                    513:   </dl><!-- Proposals for v2:
                    514:        * <select value=""> as an alternative to <option selected>
                    515:          http://developers.slashdot.org/comments.pl?sid=426306&cid=22142072
1.11      mike      516:          <Philip`> http://www.ipiao.com.cn/ does <select size="1" name="to"><script type="text/javascript">City_Default="PEK"</script><SCRIPT language=javascript
1.9       mike      517:                    src="/js/flightcity.js"></SCRIPT></select> which is the kind of thing that could be much simpler with <select value="PEK">
1.234     mike      518:     --><p>The <code><a href="#the-select-element" id="select-18">select</a></code> element represents a control for
1.160     mike      519:   selecting amongst a set of options.<p>The <dfn id="attr-select-multiple" title="attr-select-multiple"><code>multiple</code></dfn>
1.156     mike      520:   attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute-13">boolean attribute</a>. If the attribute is
1.234     mike      521:   present, then the <code><a href="#the-select-element" id="select-19">select</a></code> element
1.162     mike      522:   <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a control for selecting zero or more options
1.156     mike      523:   from the <a href="#concept-select-option-list" id="concept-select-option-list-1" title="concept-select-option-list">list of
1.9       mike      524:   options</a>. If the attribute is absent, then the
1.234     mike      525:   <code><a href="#the-select-element" id="select-20">select</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a control for
1.160     mike      526:   selecting a single option from the <a href="#concept-select-option-list" id="concept-select-option-list-2" title="concept-select-option-list">list of options</a>.<p>The <dfn id="attr-select-size" title="attr-select-size"><code>size</code></dfn>
1.156     mike      527:   attribute gives the number of options to show to the user. The <code title="attr-input-size"><a href="common-input-element-attributes.html#attr-input-size" id="size-26">size</a></code> attribute, if specified, must
                    528:   have a value that is a <a href="common-microsyntaxes.html#valid-non-negative-integer" id="valid-non-negative-integer-10">valid non-negative integer</a>
                    529:   greater than zero. If the <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple-30">multiple</a></code> attribute is present,
                    530:   then the <code title="attr-input-size"><a href="common-input-element-attributes.html#attr-input-size" id="size-27">size</a></code> attribute's
                    531:   default value is 4. If the <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple-31">multiple</a></code> attribute is absent,
                    532:   then the <code title="attr-input-size"><a href="common-input-element-attributes.html#attr-input-size" id="size-28">size</a></code> attribute's
1.160     mike      533:   default value is 1.<p>The <dfn id="concept-select-option-list" title="concept-select-option-list">list of options</dfn>
1.234     mike      534:   for a <code><a href="#the-select-element" id="select-21">select</a></code> element consists of all the
                    535:   <code><a href="#the-option-element" id="option-10">option</a></code> element children of the <code><a href="#the-select-element" id="select-22">select</a></code>
1.191     mike      536:   element, and all the <code><a href="#the-option-element" id="option-11">option</a></code> element children of all the
1.234     mike      537:   <code><a href="#the-optgroup-element" id="optgroup-4">optgroup</a></code> element children of the <code><a href="#the-select-element" id="select-23">select</a></code>
1.322     mike      538:   element, in <a href="infrastructure.html#tree-order" id="tree-order-7">tree order</a>.<p>The <dfn id="attr-select-required" title="attr-select-required"><code>required</code></dfn>
1.156     mike      539:   attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute-14">boolean attribute</a>. When specified, the
1.138     mike      540:   user will be required to select a value before submitting the
1.234     mike      541:   form.<p>If a <code><a href="#the-select-element" id="select-24">select</a></code> element has a <code title="attr-select-required"><a href="#attr-select-required" id="required-29">required</a></code> attribute specified,
1.156     mike      542:   does not have a <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple-32">multiple</a></code>
1.162     mike      543:   attribute specified, and has a <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#concept-select-size" title='Read about this "display size" reference in the full HTML5 spec.'>display size</a> of 1; and if the
1.156     mike      544:   <a href="#concept-option-value" id="concept-option-value-0" title="concept-option-value">value</a> of the first
1.234     mike      545:   <code><a href="#the-option-element" id="option-12">option</a></code> element in the <code><a href="#the-select-element" id="select-25">select</a></code> element's
1.156     mike      546:   <a href="#concept-select-option-list" id="concept-select-option-list-3" title="concept-select-option-list">list of options</a> (if
1.191     mike      547:   any) is the empty string, and that <code><a href="#the-option-element" id="option-13">option</a></code> is not <a href="#concept-option-disabled" id="concept-option-disabled-0" title="concept-option-disabled">disabled</a>, and, finally, that
1.234     mike      548:   <code><a href="#the-option-element" id="option-14">option</a></code> element's parent node is the <code><a href="#the-select-element" id="select-26">select</a></code>
1.190     mike      549:   element (and not an <code><a href="#the-optgroup-element" id="optgroup-5">optgroup</a></code> element), then that
1.234     mike      550:   <code><a href="#the-option-element" id="option-15">option</a></code> is the <code><a href="#the-select-element" id="select-27">select</a></code> element's
1.262     mike      551:   <dfn id="placeholder-label-option">placeholder label option</dfn>.<p>The <code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-52">form</a></code> attribute is used to
1.234     mike      552:   explicitly associate the <code><a href="#the-select-element" id="select-28">select</a></code> element with its
1.156     mike      553:   <a href="association-of-controls-and-forms.html#form-owner" id="form-owner-9">form owner</a>. The <code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-40">name</a></code>
                    554:   attribute represents the element's name. The <code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled-15">disabled</a></code> attribute is used to make
1.9       mike      555:   the control non-interactive and to prevent its value from being
1.156     mike      556:   submitted. The <code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus-4">autofocus</a></code>
1.162     mike      557:   attribute controls focus.<dl class="domintro"><dt><var title="">select</var> . <code title="dom-select-type"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-type" title='Read about this "type" reference in the full HTML5 spec.'>type</a></code></dt>
1.9       mike      558: 
                    559:    <dd>
                    560: 
                    561:     <p>Returns "<code title="">select-multiple</code>" if the element
1.156     mike      562:     has a <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple-33">multiple</a></code>
1.9       mike      563:     attribute, and "<code title="">select-one</code>"
                    564:     otherwise.</p>
                    565: 
                    566:    </dd>
                    567: 
1.162     mike      568:    <dt><var title="">select</var> . <code title="dom-select-options"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-options" title='Read about this "options" reference in the full HTML5 spec.'>options</a></code></dt>
1.9       mike      569: 
                    570:    <dd>
                    571: 
1.156     mike      572:     <p>Returns an <code><a href="urls.html#htmloptionscollection" id="htmloptionscollection-4">HTMLOptionsCollection</a></code> of the <a href="#concept-select-option-list" id="concept-select-option-list-4" title="concept-select-option-list">list of options</a>.</p>
1.9       mike      573: 
                    574:    </dd>
                    575: 
1.162     mike      576:    <dt><var title="">select</var> . <code title="dom-select-length"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-length" title='Read about this "length" reference in the full HTML5 spec.'>length</a></code> [ = <var title="">value</var> ]</dt>
1.9       mike      577:    <dd>
1.156     mike      578:     <p>Returns the number of elements in the <a href="#concept-select-option-list" id="concept-select-option-list-5" title="concept-select-option-list">list of options</a>.</p>
1.234     mike      579:     <p>When set to a smaller number, truncates the number of <code><a href="#the-option-element" id="option-16">option</a></code> elements in the <code><a href="#the-select-element" id="select-29">select</a></code>.</p>
                    580:     <p>When set to a greater number, adds new blank <code><a href="#the-option-element" id="option-17">option</a></code> elements to the <code><a href="#the-select-element" id="select-30">select</a></code>.</p>
1.9       mike      581:    </dd>
                    582: 
1.162     mike      583:    <dt><var title="">element</var> = <var title="">select</var> . <code title="dom-select-item"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-item" title='Read about this "item" reference in the full HTML5 spec.'>item</a></code>(<var title="">index</var>)</dt>
1.9       mike      584:    <dt><var title="">select</var>[<var title="">index</var>]</dt>
                    585:    <dd>
1.322     mike      586:     <p>Returns the item with index <var title="">index</var> from the <a href="#concept-select-option-list" id="concept-select-option-list-6" title="concept-select-option-list">list of options</a>. The items are sorted in <a href="infrastructure.html#tree-order" id="tree-order-8">tree order</a>.</p>
1.9       mike      587:     <p>Returns null if <var title="">index</var> is out of range.</p>
                    588:    </dd>
                    589: 
1.162     mike      590:    <dt><var title="">element</var> = <var title="">select</var> . <code title="dom-select-item"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-item" title='Read about this "namedItem" reference in the full HTML5 spec.'>namedItem</a></code>(<var title="">name</var>)</dt>
1.9       mike      591:    <dd>
1.201     mike      592:     <p>Returns the item with <a href="elements.html#concept-id" id="concept-id-17" title="concept-id">ID</a> or <code title="attr-option-name"><a href="obsolete.html#attr-option-name" id="name-59">name</a></code> <var title="">name</var> from the <a href="#concept-select-option-list" id="concept-select-option-list-7" title="concept-select-option-list">list of options</a>.</p>
1.162     mike      593:     <p>If there are multiple matching items, then a <code><a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#nodelist" title='Read about this "NodeList" reference in the full HTML5 spec.'>NodeList</a></code> object containing all those elements is returned.</p>
1.201     mike      594:     <p>Returns null if no element with that <a href="elements.html#concept-id" id="concept-id-18" title="concept-id">ID</a> could be found.</p>
1.9       mike      595:    </dd>
                    596: 
1.162     mike      597:    <dt><var title="">select</var> . <code title="dom-select-add"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-add" title='Read about this "add" reference in the full HTML5 spec.'>add</a></code>(<var title="">element</var> [, <var title="">before</var> ])</dt>
1.9       mike      598:    <dd>
                    599:     <p>Inserts <var title="">element</var> before the node given by <var title="">before</var>.</p>
                    600:     <p>The <var title="">before</var> argument can be a number, in
                    601:     which case <var title="">element</var> is inserted before the item
1.156     mike      602:     with that number, or an element from the <a href="#concept-select-option-list" id="concept-select-option-list-8" title="concept-select-option-list">list of options</a>, in
1.9       mike      603:     which case <var title="">element</var> is inserted before that
                    604:     element.</p>
                    605:     <p>If <var title="">before</var> is omitted, null, or a number out
                    606:     of range, then <var title="">element</var> will be added at the
                    607:     end of the list.</p>
1.156     mike      608:     <p>This method will throw a <code><a href="urls.html#hierarchy_request_err" id="hierarchy_request_err-5">HIERARCHY_REQUEST_ERR</a></code>
1.9       mike      609:     exception if <var title="">element</var> is an ancestor of the
1.191     mike      610:     element into which it is to be inserted. If <var title="">element</var> is not an <code><a href="#the-option-element" id="option-18">option</a></code> or
1.190     mike      611:     <code><a href="#the-optgroup-element" id="optgroup-6">optgroup</a></code> element, then the method does nothing.</p>
1.9       mike      612:    </dd>
                    613: 
1.162     mike      614:    <dt><var title="">select</var> . <code title="dom-select-selectedOptions"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-selectedoptions" title='Read about this "selectedOptions" reference in the full HTML5 spec.'>selectedOptions</a></code></dt>
1.9       mike      615: 
                    616:    <dd>
                    617: 
1.202     mike      618:     <p>Returns an <code><a href="urls.html#htmlcollection" id="htmlcollection-35">HTMLCollection</a></code> of the <a href="#concept-select-option-list" id="concept-select-option-list-9" title="concept-select-option-list">list of options</a> that are
1.9       mike      619:     selected.</p>
                    620: 
                    621:    </dd>
                    622: 
1.162     mike      623:    <dt><var title="">select</var> . <code title="dom-select-selectedIndex"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-selectedindex" title='Read about this "selectedIndex" reference in the full HTML5 spec.'>selectedIndex</a></code> [ = <var title="">value</var> ]</dt>
1.9       mike      624: 
                    625:    <dd>
                    626: 
                    627:     <p>Returns the index of the first selected item, if any, or
1.160     mike      628:     &minus;1 if there is no selected item.</p>
1.9       mike      629: 
                    630:     <p>Can be set, to change the selection.</p>
                    631: 
                    632:    </dd>
                    633: 
1.162     mike      634:    <dt><var title="">select</var> . <code title="dom-select-value"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a></code> [ = <var title="">value</var> ]</dt>
1.9       mike      635: 
                    636:    <dd>
                    637: 
1.162     mike      638:     <p>Returns the <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#concept-fe-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a> of the
1.9       mike      639:     first selected item, if any, or the empty string if there is no
                    640:     selected item.</p>
                    641: 
                    642:     <p>Can be set, to change the selection.</p>
                    643: 
                    644:    </dd>
                    645: 
                    646:   </dl><div class="example">
                    647: 
1.234     mike      648:    <p>The following example shows how a <code><a href="#the-select-element" id="select-31">select</a></code> element
1.9       mike      649:    can be used to offer the user with a set of options from which the
                    650:    user can select a single option. The default option is
                    651:    preselected.</p>
                    652: 
                    653:    <pre>&lt;p&gt;
                    654:  &lt;label for="unittype"&gt;Select unit type:&lt;/label&gt;
                    655:  &lt;select id="unittype" name="unittype"&gt;
                    656:   &lt;option value="1"&gt; Miner &lt;/option&gt;
                    657:   &lt;option value="2"&gt; Puffer &lt;/option&gt;
                    658:   &lt;option value="3" selected&gt; Snipey &lt;/option&gt;
                    659:   &lt;option value="4"&gt; Max &lt;/option&gt;
                    660:   &lt;option value="5"&gt; Firebot &lt;/option&gt;
                    661:  &lt;/select&gt;
                    662: &lt;/p&gt;</pre>
                    663: 
                    664:   </div><div class="example">
                    665: 
                    666:    <p>Here, the user is offered a set of options from which he can
                    667:    select any number. By default, all five options are selected.</p>
                    668: 
                    669:    <pre>&lt;p&gt;
                    670:  &lt;label for="allowedunits"&gt;Select unit types to enable on this map:&lt;/label&gt;
                    671:  &lt;select id="allowedunits" name="allowedunits" multiple&gt;
                    672:   &lt;option value="1" selected&gt; Miner &lt;/option&gt;
                    673:   &lt;option value="2" selected&gt; Puffer &lt;/option&gt;
                    674:   &lt;option value="3" selected&gt; Snipey &lt;/option&gt;
                    675:   &lt;option value="4" selected&gt; Max &lt;/option&gt;
                    676:   &lt;option value="5" selected&gt; Firebot &lt;/option&gt;
                    677:  &lt;/select&gt;
                    678: &lt;/p&gt;</pre>
                    679: 
1.202     mike      680:   </div><h4 id="the-datalist-element"><span class="secno">4.10.10 </span>The <dfn><code>datalist</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.321     mike      681:    <dd><a href="content-models.html#flow-content" id="flow-content-127">Flow content</a>.</dd>
                    682:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-138">Phrasing content</a>.</dd>
1.203     mike      683:    <dt>Contexts in which this element can be used:</dt>
1.321     mike      684:    <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content-139">phrasing content</a> is expected.</dd>
1.9       mike      685:    <dt>Content model:</dt>
1.321     mike      686:    <dd>Either: <a href="content-models.html#phrasing-content" id="phrasing-content-140">phrasing content</a>.</dd>
1.191     mike      687:    <dd>Or: Zero or more <code><a href="#the-option-element" id="option-19">option</a></code> elements.</dd>
1.9       mike      688:    <dt>Content attributes:</dt>
1.321     mike      689:    <dd><a href="elements.html#global-attributes" id="global-attributes-90">Global attributes</a></dd>
1.9       mike      690:    <dt>DOM interface:</dt>
                    691:    <dd>
1.321     mike      692: <pre class="idl">interface <dfn id="htmldatalistelement">HTMLDataListElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-101">HTMLElement</a> {
1.202     mike      693:   readonly attribute <a href="urls.html#htmlcollection" id="htmlcollection-36">HTMLCollection</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-datalist-options" title='Read about this "options" reference in the full HTML5 spec.'>options</a>;
1.9       mike      694: };</pre>
                    695:    </dd>
1.156     mike      696:   </dl><p>The <code><a href="#the-datalist-element" id="datalist-13">datalist</a></code> element represents a set of
1.191     mike      697:   <code><a href="#the-option-element" id="option-20">option</a></code> elements that represent predefined options for
1.9       mike      698:   other controls. The contents of the element represents fallback
1.191     mike      699:   content for legacy user agents, intermixed with <code><a href="#the-option-element" id="option-21">option</a></code>
1.9       mike      700:   elements that represent the predefined options. In the rendering,
1.162     mike      701:   the <code><a href="#the-datalist-element" id="datalist-14">datalist</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a>
1.160     mike      702:   nothing.<p>The <code><a href="#the-datalist-element" id="datalist-15">datalist</a></code> element is hooked up to an
1.323     mike      703:   <code><a href="the-input-element.html#the-input-element" id="input-118">input</a></code> element using the <code title="attr-input-list"><a href="common-input-element-attributes.html#attr-input-list" id="list-29">list</a></code> attribute on the
                    704:   <code><a href="the-input-element.html#the-input-element" id="input-119">input</a></code> element.<p>Each <code><a href="#the-option-element" id="option-22">option</a></code> element that is a descendant of the
1.156     mike      705:   <code><a href="#the-datalist-element" id="datalist-16">datalist</a></code> element, that is not <a href="#concept-option-disabled" id="concept-option-disabled-1" title="concept-option-disabled">disabled</a>, and whose <a href="#concept-option-value" id="concept-option-value-1" title="concept-option-value">value</a> is a string that isn't the
                    706:   empty string, represents a suggestion. Each suggestion has a <a href="#concept-option-value" id="concept-option-value-2" title="concept-option-value">value</a> and a <a href="#concept-option-label" id="concept-option-label-0" title="concept-option-label">label</a>.
1.9       mike      707: 
1.162     mike      708:   <dl class="domintro"><dt><var title="">datalist</var> . <code title="dom-datalist-options"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-datalist-options" title='Read about this "options" reference in the full HTML5 spec.'>options</a></code></dt>
1.9       mike      709: 
                    710:    <dd>
1.202     mike      711:     <p>Returns an <code><a href="urls.html#htmlcollection" id="htmlcollection-37">HTMLCollection</a></code> of the <code>options</code> elements of the table.</p>
1.9       mike      712:    </dd>
                    713: 
1.202     mike      714:   </dl><h4 id="the-optgroup-element"><span class="secno">4.10.11 </span>The <dfn><code>optgroup</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.9       mike      715:    <dd>None.</dd>
1.203     mike      716:    <dt>Contexts in which this element can be used:</dt>
1.234     mike      717:    <dd>As a child of a <code><a href="#the-select-element" id="select-32">select</a></code> element.</dd>
1.9       mike      718:    <dt>Content model:</dt>
1.191     mike      719:    <dd>Zero or more <code><a href="#the-option-element" id="option-23">option</a></code> elements.</dd>
1.9       mike      720:    <dt>Content attributes:</dt>
1.321     mike      721:    <dd><a href="elements.html#global-attributes" id="global-attributes-91">Global attributes</a></dd>
1.156     mike      722:    <dd><code title="attr-optgroup-disabled"><a href="#attr-optgroup-disabled" id="disabled-3">disabled</a></code></dd>
1.304     mike      723:    <dd><code title="attr-optgroup-label"><a href="#attr-optgroup-label" id="label-31">label</a></code></dd>
1.9       mike      724:    <dt>DOM interface:</dt>
                    725:    <dd>
1.321     mike      726: <pre class="idl">interface <dfn id="htmloptgroupelement">HTMLOptGroupElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-102">HTMLElement</a> {
1.162     mike      727:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-optgroup-disabled" title='Read about this "disabled" reference in the full HTML5 spec.'>disabled</a>;
                    728:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-optgroup-label" title='Read about this "label" reference in the full HTML5 spec.'>label</a>;
1.9       mike      729: };</pre>
                    730:    </dd>
1.190     mike      731:   </dl><!-- v2: make optgroups selectable if they have a value. --><p>The <code><a href="#the-optgroup-element" id="optgroup-7">optgroup</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a group of
1.191     mike      732:   <code><a href="#the-option-element" id="option-24">option</a></code> elements with a common label.<p>The element's group of <code><a href="#the-option-element" id="option-25">option</a></code> elements consists of
                    733:   the <code><a href="#the-option-element" id="option-26">option</a></code> elements that are children of the
1.190     mike      734:   <code><a href="#the-optgroup-element" id="optgroup-8">optgroup</a></code> element.<p>The <dfn id="attr-optgroup-disabled" title="attr-optgroup-disabled"><code>disabled</code></dfn> attribute
1.156     mike      735:   is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute-15">boolean attribute</a> and can be used to <a href="#concept-option-disabled" id="concept-option-disabled-2" title="concept-option-disabled">disable</a> a group of
1.191     mike      736:   <code><a href="#the-option-element" id="option-27">option</a></code> elements together.<p>The <dfn id="attr-optgroup-label" title="attr-optgroup-label"><code>label</code></dfn>
1.9       mike      737:   attribute must be specified. Its value gives the name of the group,
1.160     mike      738:   for the purposes of the user interface. <div class="example">
1.9       mike      739: 
                    740:    <p>The following snippet shows how a set of lessons from three
1.234     mike      741:    courses could be offered in a <code><a href="#the-select-element" id="select-33">select</a></code> drop-down
1.9       mike      742:    widget:</p>
                    743: 
                    744:    <pre>&lt;form action="courseselector.dll" method="get"&gt;
                    745:  &lt;p&gt;Which course would you like to watch today?
                    746:  &lt;p&gt;&lt;label&gt;Course:
                    747:   &lt;select name="c"&gt;
                    748:    &lt;optgroup label="8.01 Physics I: Classical Mechanics"&gt;
                    749:     &lt;option value="8.01.1"&gt;Lecture 01: Powers of Ten
                    750:     &lt;option value="8.01.2"&gt;Lecture 02: 1D Kinematics
                    751:     &lt;option value="8.01.3"&gt;Lecture 03: Vectors
                    752:    &lt;optgroup label="8.02 Electricity and Magnestism"&gt;
                    753:     &lt;option value="8.02.1"&gt;Lecture 01: What holds our world together?
                    754:     &lt;option value="8.02.2"&gt;Lecture 02: Electric Field
                    755:     &lt;option value="8.02.3"&gt;Lecture 03: Electric Flux
                    756:    &lt;optgroup label="8.03 Physics III: Vibrations and Waves"&gt;
                    757:     &lt;option value="8.03.1"&gt;Lecture 01: Periodic Phenomenon
                    758:     &lt;option value="8.03.2"&gt;Lecture 02: Beats
                    759:     &lt;option value="8.03.3"&gt;Lecture 03: Forced Oscillations with Damping
                    760:   &lt;/select&gt;
                    761:  &lt;/label&gt;
1.320     mike      762:  &lt;p&gt;&lt;input type=submit value="&#9654; Play"&gt;
1.9       mike      763: &lt;/form&gt;</pre>
                    764: 
1.202     mike      765:   </div><h4 id="the-option-element"><span class="secno">4.10.12 </span>The <dfn><code>option</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.9       mike      766:    <dd>None.</dd>
1.203     mike      767:    <dt>Contexts in which this element can be used:</dt>
1.234     mike      768:    <dd>As a child of a <code><a href="#the-select-element" id="select-34">select</a></code> element.</dd>
1.156     mike      769:    <dd>As a child of a <code><a href="#the-datalist-element" id="datalist-17">datalist</a></code> element.</dd>
1.190     mike      770:    <dd>As a child of an <code><a href="#the-optgroup-element" id="optgroup-9">optgroup</a></code> element.</dd>
1.9       mike      771:    <dt>Content model:</dt>
1.156     mike      772:    <dd><a href="content-models.html#text-content" id="text-content-4" title="text content">Text</a>.</dd>
1.9       mike      773:    <dt>Content attributes:</dt>
1.321     mike      774:    <dd><a href="elements.html#global-attributes" id="global-attributes-92">Global attributes</a></dd>
1.156     mike      775:    <dd><code title="attr-option-disabled"><a href="#attr-option-disabled" id="disabled-6">disabled</a></code></dd>
1.304     mike      776:    <dd><code title="attr-option-label"><a href="#attr-option-label" id="label-33">label</a></code></dd>
1.156     mike      777:    <dd><code title="attr-option-selected"><a href="#attr-option-selected" id="selected-0">selected</a></code></dd>
1.255     mike      778:    <dd><code title="attr-option-value"><a href="#attr-option-value" id="value-34">value</a></code></dd>
1.9       mike      779:    <dt>DOM interface:</dt>
                    780:    <dd>
1.162     mike      781: <pre class="idl">[NamedConstructor=<a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option" title='Read about this "Option" reference in the full HTML5 spec.'>Option</a>(),
                    782:  NamedConstructor=<a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-t" title='Read about this "Option" reference in the full HTML5 spec.'>Option</a>(in DOMString text),
                    783:  NamedConstructor=<a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-tv" title='Read about this "Option" reference in the full HTML5 spec.'>Option</a>(in DOMString text, in DOMString value),
                    784:  NamedConstructor=<a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-tvd" title='Read about this "Option" reference in the full HTML5 spec.'>Option</a>(in DOMString text, in DOMString value, in boolean defaultSelected),
                    785:  NamedConstructor=<a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-tvds" title='Read about this "Option" reference in the full HTML5 spec.'>Option</a>(in DOMString text, in DOMString value, in boolean defaultSelected, in boolean selected)]
1.321     mike      786: interface <dfn id="htmloptionelement">HTMLOptionElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-103">HTMLElement</a> {
1.162     mike      787:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-disabled" title='Read about this "disabled" reference in the full HTML5 spec.'>disabled</a>;
                    788:   readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement-7">HTMLFormElement</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-form" title='Read about this "form" reference in the full HTML5 spec.'>form</a>;
                    789:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-label" title='Read about this "label" reference in the full HTML5 spec.'>label</a>;
                    790:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-defaultselected" title='Read about this "defaultSelected" reference in the full HTML5 spec.'>defaultSelected</a>;
                    791:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-selected" title='Read about this "selected" reference in the full HTML5 spec.'>selected</a>;
                    792:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a>;
1.9       mike      793: 
1.162     mike      794:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-text" title='Read about this "text" reference in the full HTML5 spec.'>text</a>;
                    795:   readonly attribute long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-index" title='Read about this "index" reference in the full HTML5 spec.'>index</a>;
1.9       mike      796: };</pre>
                    797:    </dd>
1.191     mike      798:   </dl><p>The <code><a href="#the-option-element" id="option-28">option</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> an option
1.234     mike      799:   in a <code><a href="#the-select-element" id="select-35">select</a></code> element or as part of a list of suggestions
1.160     mike      800:   in a <code><a href="#the-datalist-element" id="datalist-18">datalist</a></code> element.<p>In certain circumstances described in the definition of the
1.234     mike      801:   <code><a href="#the-select-element" id="select-36">select</a></code> element, an <code><a href="#the-option-element" id="option-29">option</a></code> element can be a
                    802:   <code><a href="#the-select-element" id="select-37">select</a></code> element's <a href="#placeholder-label-option" id="placeholder-label-option-0">placeholder label option</a>.
1.156     mike      803:   A <a href="#placeholder-label-option" id="placeholder-label-option-1">placeholder label option</a> does not represent an actual
1.234     mike      804:   option, but instead represents a label for the <code><a href="#the-select-element" id="select-38">select</a></code>
1.160     mike      805:   control.<p>The <dfn id="attr-option-disabled" title="attr-option-disabled"><code>disabled</code></dfn>
1.156     mike      806:   attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute-16">boolean attribute</a>. An
1.191     mike      807:   <code><a href="#the-option-element" id="option-30">option</a></code> element is <dfn id="concept-option-disabled" title="concept-option-disabled">disabled</dfn> if its <code title="attr-option-disabled"><a href="#attr-option-disabled" id="disabled-7">disabled</a></code> attribute is present or
1.190     mike      808:   if it is a child of an <code><a href="#the-optgroup-element" id="optgroup-10">optgroup</a></code> element whose <code title="attr-optgroup-disabled"><a href="#attr-optgroup-disabled" id="disabled-4">disabled</a></code> attribute is
1.160     mike      809:   present.<p>The <dfn id="attr-option-label" title="attr-option-label"><code>label</code></dfn>
1.191     mike      810:   attribute provides a label for element. The <dfn id="concept-option-label" title="concept-option-label">label</dfn> of an <code><a href="#the-option-element" id="option-31">option</a></code>
1.304     mike      811:   element is the value of the <code title="attr-option-label"><a href="#attr-option-label" id="label-34">label</a></code> attribute, if there is one,
1.162     mike      812:   or the <code><a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#textcontent" title='Read about this "textContent" reference in the full HTML5 spec.'>textContent</a></code> of the element, if there isn't.<p>The <dfn id="attr-option-value" title="attr-option-value"><code>value</code></dfn>
1.191     mike      813:   attribute provides a value for element. The <dfn id="concept-option-value" title="concept-option-value">value</dfn> of an <code><a href="#the-option-element" id="option-32">option</a></code>
1.255     mike      814:   element is the value of the <code title="attr-option-value"><a href="#attr-option-value" id="value-35">value</a></code> attribute, if there is one,
1.162     mike      815:   or the <code><a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#textcontent" title='Read about this "textContent" reference in the full HTML5 spec.'>textContent</a></code> of the element, if there isn't.<p>The <dfn id="attr-option-selected" title="attr-option-selected"><code>selected</code></dfn>
1.298     mike      816:   attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute-17">boolean attribute</a>. It represents the
                    817:   default <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#concept-option-selectedness" title='Read about this "selectedness" reference in the full HTML5 spec.'>selectedness</a> of the
1.234     mike      818:   element.<p>A <code><a href="#the-select-element" id="select-39">select</a></code> element whose <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple-34">multiple</a></code> attribute is not
1.191     mike      819:   specified must not have more than one descendant <code><a href="#the-option-element" id="option-33">option</a></code>
1.156     mike      820:   element with its <code title="attr-option-selected"><a href="#attr-option-selected" id="selected-1">selected</a></code>
1.162     mike      821:   attribute set.<dl class="domintro"><dt><var title="">option</var> . <code title="dom-option-selected"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-selected" title='Read about this "selected" reference in the full HTML5 spec.'>selected</a></code></dt>
1.9       mike      822: 
                    823:    <dd>
                    824: 
                    825:     <p>Returns true if the element is selected, and false otherwise.</p>
                    826: 
1.202     mike      827:     <p>Can be set, to override the current state of the element.</p>
                    828: 
1.9       mike      829:    </dd>
                    830: 
1.162     mike      831:    <dt><var title="">option</var> . <code title="dom-option-index"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-index" title='Read about this "index" reference in the full HTML5 spec.'>index</a></code></dt>
1.9       mike      832: 
                    833:    <dd>
                    834: 
1.234     mike      835:     <p>Returns the index of the element in its <code><a href="#the-select-element" id="select-40">select</a></code>
1.162     mike      836:     element's <code title="dom-select-options"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-select-options" title='Read about this "options" reference in the full HTML5 spec.'>options</a></code>
1.9       mike      837:     list.</p>
                    838: 
                    839:    </dd>
                    840: 
1.162     mike      841:    <dt><var title="">option</var> . <code title="dom-option-form"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-form" title='Read about this "form" reference in the full HTML5 spec.'>form</a></code></dt>
1.9       mike      842: 
                    843:    <dd>
                    844: 
1.262     mike      845:     <p>Returns the element's <code><a href="forms.html#the-form-element" id="form-22">form</a></code> element, if any, or
1.9       mike      846:     null otherwise.</p>
                    847: 
                    848:    </dd>
                    849: 
1.162     mike      850:    <dt><var title="">option</var> . <code title="dom-option-text"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option-text" title='Read about this "text" reference in the full HTML5 spec.'>text</a></code></dt>
1.11      mike      851: 
                    852:    <dd>
                    853: 
1.206     mike      854:     <p>Same as <code><a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#textcontent" title='Read about this "textContent" reference in the full HTML5 spec.'>textContent</a></code>, except that spaces are collapsed.</p>
1.11      mike      855: 
                    856:    </dd>
                    857: 
1.162     mike      858:    <dt><var title="">option</var> = new <code title="dom-option"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-option" title='Read about this "Option" reference in the full HTML5 spec.'>Option</a></code>( [ <var title="">text</var> [, <var title="">value</var> [, <var title="">defaultSelected</var> [, <var title="">selected</var> ] ] ] ] )</dt>
1.9       mike      859: 
                    860:    <dd>
                    861: 
1.191     mike      862:     <p>Returns a new <code><a href="#the-option-element" id="option-34">option</a></code> element.</p>
1.9       mike      863: 
                    864:     <p>The <var title="">text</var> argument sets the contents of the element.</p>
1.255     mike      865:     <p>The <var title="">value</var> argument sets the <code title="attr-option-value"><a href="#attr-option-value" id="value-36">value</a></code> attribute.</p>
1.156     mike      866:     <p>The <var title="">defaultSelected</var> argument sets the <code title="attr-option-selected"><a href="#attr-option-selected" id="selected-2">selected</a></code> attribute.</p>
1.9       mike      867:     <p>The <var title="">selected</var> argument sets whether or not the element is selected. If it is omitted, even if the <var title="">defaultSelected</var> argument is true, the element is not selected.</p>
                    868: 
                    869:    </dd>
                    870: 
1.202     mike      871:   </dl><h4 id="the-textarea-element"><span class="secno">4.10.13 </span>The <dfn><code>textarea</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.321     mike      872:    <dd><a href="content-models.html#flow-content" id="flow-content-128">Flow content</a>.</dd>
                    873:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-141">Phrasing content</a>.</dd>
1.156     mike      874:    <dd><a href="content-models.html#interactive-content" id="interactive-content-17">Interactive content</a>.</dd>
1.202     mike      875:    <dd><a href="forms.html#category-listed" id="category-listed-7" title="category-listed">Listed</a>, <a href="forms.html#category-label" id="category-label-5" title="category-label">labelable</a>, <a href="forms.html#category-submit" id="category-submit-6" title="category-submit">submittable</a>, and <a href="forms.html#category-reset" id="category-reset-3" title="category-reset">resettable</a> <a href="forms.html#form-associated-element" id="form-associated-element-11">form-associated element</a>.</dd>
1.203     mike      876:    <dt>Contexts in which this element can be used:</dt>
1.321     mike      877:    <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content-142">phrasing content</a> is expected.</dd>
1.9       mike      878:    <dt>Content model:</dt>
1.156     mike      879:    <dd><a href="content-models.html#text-content" id="text-content-5" title="text content">Text</a>.</dd>
1.9       mike      880:    <dt>Content attributes:</dt>
1.321     mike      881:    <dd><a href="elements.html#global-attributes" id="global-attributes-93">Global attributes</a></dd>
1.156     mike      882:    <dd><code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus-5">autofocus</a></code></dd>
                    883:    <dd><code title="attr-textarea-cols"><a href="#attr-textarea-cols" id="cols">cols</a></code></dd>
                    884:    <dd><code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled-16">disabled</a></code></dd>
1.323     mike      885:    <dd><code title="attr-textarea-dirname"><a href="#attr-textarea-dirname" id="dirname-26">dirname</a></code></dd>
1.262     mike      886:    <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-53">form</a></code></dd>
1.156     mike      887:    <dd><code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength" id="maxlength-27">maxlength</a></code></dd>
                    888:    <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-41">name</a></code></dd>
                    889:    <dd><code title="attr-textarea-placeholder"><a href="#attr-textarea-placeholder" id="placeholder-28">placeholder</a></code></dd>
1.187     mike      890:    <dd><code title="attr-textarea-readonly"><a href="#attr-textarea-readonly" id="readonly-41">readonly</a></code></dd>
1.234     mike      891:    <dd><code title="attr-textarea-required"><a href="#attr-textarea-required" id="required-32">required</a></code></dd>
1.156     mike      892:    <dd><code title="attr-textarea-rows"><a href="#attr-textarea-rows" id="rows">rows</a></code></dd>
                    893:    <dd><code title="attr-textarea-wrap"><a href="#attr-textarea-wrap" id="wrap">wrap</a></code></dd>
1.9       mike      894:    <dt>DOM interface:</dt>
                    895:    <dd>
1.321     mike      896: <pre class="idl">interface <dfn id="htmltextareaelement">HTMLTextAreaElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-104">HTMLElement</a> {
1.162     mike      897:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-autofocus" title='Read about this "autofocus" reference in the full HTML5 spec.'>autofocus</a>;
                    898:            attribute unsigned long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-cols" title='Read about this "cols" reference in the full HTML5 spec.'>cols</a>;
                    899:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-disabled" title='Read about this "disabled" reference in the full HTML5 spec.'>disabled</a>;
1.323     mike      900:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/.html#dom-textarea-dirname" title='Read about this "dirName" reference in the full HTML5 spec.'>dirName</a>;
1.162     mike      901:   readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement-8">HTMLFormElement</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fae-form" title='Read about this "form" reference in the full HTML5 spec.'>form</a>;
                    902:            attribute long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-maxlength" title='Read about this "maxLength" reference in the full HTML5 spec.'>maxLength</a>;
                    903:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-name" title='Read about this "name" reference in the full HTML5 spec.'>name</a>;
                    904:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-placeholder" title='Read about this "placeholder" reference in the full HTML5 spec.'>placeholder</a>;
                    905:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-readonly" title='Read about this "readOnly" reference in the full HTML5 spec.'>readOnly</a>;
                    906:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-required" title='Read about this "required" reference in the full HTML5 spec.'>required</a>;
                    907:            attribute unsigned long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-rows" title='Read about this "rows" reference in the full HTML5 spec.'>rows</a>;
                    908:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-wrap" title='Read about this "wrap" reference in the full HTML5 spec.'>wrap</a>;
                    909: 
                    910:   readonly attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-type" title='Read about this "type" reference in the full HTML5 spec.'>type</a>;
                    911:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-defaultvalue" title='Read about this "defaultValue" reference in the full HTML5 spec.'>defaultValue</a>;
                    912:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a>;
                    913:   readonly attribute unsigned long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-textlength" title='Read about this "textLength" reference in the full HTML5 spec.'>textLength</a>;
                    914: 
                    915:   readonly attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-willvalidate" title='Read about this "willValidate" reference in the full HTML5 spec.'>willValidate</a>;
                    916:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#validitystate" title='Read about this "ValidityState" reference in the full HTML5 spec.'>ValidityState</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validity" title='Read about this "validity" reference in the full HTML5 spec.'>validity</a>;
                    917:   readonly attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validationmessage" title='Read about this "validationMessage" reference in the full HTML5 spec.'>validationMessage</a>;
                    918:   boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-checkvalidatity" title='Read about this "checkValidity" reference in the full HTML5 spec.'>checkValidity</a>();
                    919:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title='Read about this "setCustomValidity" reference in the full HTML5 spec.'>setCustomValidity</a>(in DOMString error);
                    920: 
                    921:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#nodelist" title='Read about this "NodeList" reference in the full HTML5 spec.'>NodeList</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/forms.html#dom-lfe-labels" title='Read about this "labels" reference in the full HTML5 spec.'>labels</a>;
                    922: 
                    923:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/editing.html#dom-textarea-input-select" title='Read about this "select" reference in the full HTML5 spec.'>select</a>();
                    924:            attribute unsigned long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/editing.html#dom-textarea-input-selectionstart" title='Read about this "selectionStart" reference in the full HTML5 spec.'>selectionStart</a>;
                    925:            attribute unsigned long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/editing.html#dom-textarea-input-selectionend" title='Read about this "selectionEnd" reference in the full HTML5 spec.'>selectionEnd</a>;
                    926:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/editing.html#dom-textarea-input-setselectionrange" title='Read about this "setSelectionRange" reference in the full HTML5 spec.'>setSelectionRange</a>(in unsigned long start, in unsigned long end);
1.9       mike      927: };</pre>
                    928:    </dd>
1.323     mike      929:   </dl><p>The <code><a href="#the-textarea-element" id="textarea-23">textarea</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a
1.9       mike      930:   multiline plain text edit control. The contents of the control represent the
1.160     mike      931:   control's default value.<p>The <dfn id="attr-textarea-readonly" title="attr-textarea-readonly"><code>readonly</code></dfn> attribute
1.298     mike      932:   is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute-18">boolean attribute</a> used to control whether the text
1.160     mike      933:   can be edited by the user or not.<p>The <dfn id="attr-textarea-cols" title="attr-textarea-cols"><code>cols</code></dfn>
1.9       mike      934:   attribute specifies the expected maximum number of characters per
1.156     mike      935:   line. If the <code title="attr-textarea-cols"><a href="#attr-textarea-cols" id="cols-0">cols</a></code> attribute
                    936:   is specified, its value must be a <a href="common-microsyntaxes.html#valid-non-negative-integer" id="valid-non-negative-integer-11">valid non-negative
1.160     mike      937:   integer</a> greater than zero. <p>The <dfn id="attr-textarea-rows" title="attr-textarea-rows"><code>rows</code></dfn>
1.156     mike      938:   attribute specifies the number of lines to show. If the <code title="attr-textarea-rows"><a href="#attr-textarea-rows" id="rows-0">rows</a></code> attribute is specified, its
                    939:   value must be a <a href="common-microsyntaxes.html#valid-non-negative-integer" id="valid-non-negative-integer-12">valid non-negative integer</a> greater than
1.160     mike      940:   zero. <p>The <dfn id="attr-textarea-wrap" title="attr-textarea-wrap"><code>wrap</code></dfn>
1.304     mike      941:   attribute is an <a href="common-microsyntaxes.html#enumerated-attribute" id="enumerated-attribute-10">enumerated attribute</a> with two keywords
1.9       mike      942:   and states: the <dfn id="attr-textarea-wrap-soft" title="attr-textarea-wrap-soft"><code>soft</code></dfn> keyword
1.198     mike      943:   which maps to the <a href="#attr-textarea-wrap-soft-state" id="attr-textarea-wrap-soft-state-0" title="attr-textarea-wrap-soft-state">Soft</a> state, and the
1.9       mike      944:   <dfn id="attr-textarea-wrap-hard" title="attr-textarea-wrap-hard"><code>hard</code></dfn> keyword
1.198     mike      945:   which maps to the <a href="#attr-textarea-wrap-hard-state" id="attr-textarea-wrap-hard-state-0" title="attr-textarea-wrap-hard-state">Hard</a> state. The
                    946:   <i>missing value default</i> is the <a href="#attr-textarea-wrap-soft-state" id="attr-textarea-wrap-soft-state-1" title="attr-textarea-wrap-soft-state">Soft</a> state.<p>The <dfn id="attr-textarea-wrap-soft-state" title="attr-textarea-wrap-soft-state">Soft</dfn> state
1.323     mike      947:   indicates that the text in the <code><a href="#the-textarea-element" id="textarea-24">textarea</a></code> is not to be
1.198     mike      948:   wrapped when it is submitted (though it can still be wrapped in the
                    949:   rendering).<p>The <dfn id="attr-textarea-wrap-hard-state" title="attr-textarea-wrap-hard-state">Hard</dfn> state
1.323     mike      950:   indicates that the text in the <code><a href="#the-textarea-element" id="textarea-25">textarea</a></code> is to have
1.198     mike      951:   newlines added by the user agent so that the text is wrapped when it
                    952:   is submitted.<p>If the element's <code title="attr-textarea-wrap"><a href="#attr-textarea-wrap" id="wrap-0">wrap</a></code>
                    953:   attribute is in the <a href="#attr-textarea-wrap-hard-state" id="attr-textarea-wrap-hard-state-1" title="attr-textarea-wrap-hard-state">Hard</a> state, the <code title="attr-textarea-cols"><a href="#attr-textarea-cols" id="cols-1">cols</a></code> attribute must be
1.9       mike      954:   specified.</p><!-- attr-textarea-wrap-off (attr-textarea-wrap-off-state): not
                    955:   conforming; turns off the rendering of wrapping but otherwise acts
                    956:   like 'soft' --><p>The <dfn id="attr-textarea-maxlength" title="attr-textarea-maxlength"><code>maxlength</code></dfn>
1.156     mike      957:   attribute is a <a href="association-of-controls-and-forms.html#attr-fe-maxlength" id="attr-fe-maxlength-1" title="attr-fe-maxlength">form control <code title="">maxlength</code> attribute</a> controlled by the
1.323     mike      958:   <code><a href="#the-textarea-element" id="textarea-26">textarea</a></code> element's <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#concept-textarea-dirty" title='Read about this "dirty value flag" reference in the full HTML5 spec.'>dirty value flag</a>.<p>If the <code><a href="#the-textarea-element" id="textarea-27">textarea</a></code> element has a <a href="association-of-controls-and-forms.html#maximum-allowed-value-length" id="maximum-allowed-value-length-2">maximum allowed
1.9       mike      959:   value length</a>, then the element's children must be such that
1.162     mike      960:   the <a class="full-spec-link" href="http://dev.w3.org/html5/spec/common-microsyntaxes.html#code-point-length" title='Read about this "code-point length" reference in the full HTML5 spec.'>code-point length</a> of the value of the element's
                    961:   <code><a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#textcontent" title='Read about this "textContent" reference in the full HTML5 spec.'>textContent</a></code> IDL attribute is equal to or less than the
1.160     mike      962:   element's <a href="association-of-controls-and-forms.html#maximum-allowed-value-length" id="maximum-allowed-value-length-3">maximum allowed value length</a>.<p>The <dfn id="attr-textarea-required" title="attr-textarea-required"><code>required</code></dfn> attribute
1.298     mike      963:   is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute-19">boolean attribute</a>. When specified, the user will
1.9       mike      964:   be required to enter a value before submitting the form.</p><!-- similar text in the <input> section --><p>The <dfn id="attr-textarea-placeholder" title="attr-textarea-placeholder"><code>placeholder</code></dfn>
                    965:   attribute represents a hint (a word or short phrase) intended to aid
                    966:   the user with data entry. A hint could be a sample value or a brief
                    967:   description of the expected format. The attribute, if specified,
                    968:   must have a value that contains no U+000A LINE FEED (LF) or U+000D
1.160     mike      969:   CARRIAGE RETURN (CR) characters.<p class="note">For a longer hint or other advisory text, the <code title="attr-title"><a href="elements.html#the-title-attribute" id="title-26">title</a></code> attribute is more appropriate.<p>The <code title="attr-textarea-placeholder"><a href="#attr-textarea-placeholder" id="placeholder-29">placeholder</a></code>
1.9       mike      970:   attribute should not be used as an alternative to a
1.323     mike      971:   <code><a href="forms.html#the-label-element" id="label-20">label</a></code>.<p>The <dfn id="attr-textarea-dirname" title="attr-textarea-dirname"><code>dirname</code></dfn>
                    972:   attribute is a <a href="association-of-controls-and-forms.html#form-control-dirname-attribute" id="form-control-dirname-attribute-1">form control <code title="">dirname</code>
                    973:   attribute</a>.<p>The <code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-54">form</a></code> attribute is used to
                    974:   explicitly associate the <code><a href="#the-textarea-element" id="textarea-28">textarea</a></code> element with its
1.156     mike      975:   <a href="association-of-controls-and-forms.html#form-owner" id="form-owner-10">form owner</a>. The <code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-42">name</a></code>
                    976:   attribute represents the element's name. The <code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled-17">disabled</a></code> attribute is used to make
1.9       mike      977:   the control non-interactive and to prevent its value from being
1.156     mike      978:   submitted. The <code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus-6">autofocus</a></code>
1.160     mike      979:   attribute controls focus.<dl class="domintro"><dt><var title="">textarea</var> . <code title="attr-textarea-type">type</code></dt>
1.9       mike      980: 
                    981:    <dd>
                    982: 
                    983:     <p>Returns the string "<code title="">textarea</code>".</p>
                    984: 
                    985:    </dd>
                    986: 
                    987:    <dt><var title="">textarea</var> . <code title="attr-textarea-value">value</code></dt>
                    988: 
                    989:    <dd>
                    990: 
                    991:     <p>Returns the current value of the element.</p>
                    992: 
                    993:     <p>Can be set, to change the value.</p>
                    994: 
                    995:    </dd>
                    996: 
                    997:   </dl><div class="example">
                    998: 
1.323     mike      999:    <p>Here is an example of a <code><a href="#the-textarea-element" id="textarea-29">textarea</a></code> being used for
1.9       mike     1000:    unrestricted free-form text input in a form:</p>
                   1001: 
                   1002:    <pre>&lt;p&gt;If you have any comments, please let us know: &lt;textarea cols=80 name=comments&gt;&lt;/textarea&gt;&lt;/p&gt;</pre>
                   1003: 
1.323     mike     1004:    <p>To specify that a maximum length for the comments, one can use
                   1005:    the <code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength" id="maxlength-28">maxlength</a></code>
                   1006:    attribute:</p>
                   1007: 
                   1008:    <pre>&lt;p&gt;If you have any short comments, please let us know: &lt;textarea cols=80 name=comments maxlength=200&gt;&lt;/textarea&gt;&lt;/p&gt;</pre>
                   1009: 
                   1010:    <p>To give a default value, text can be included inside the element:</p>
                   1011: 
                   1012:    <pre>&lt;p&gt;If you have any comments, please let us know: &lt;textarea cols=80 name=comments&gt;You rock!&lt;/textarea&gt;&lt;/p&gt;</pre>
                   1013: 
                   1014:    <p>To have the browser submit <a href="elements.html#the-directionality" id="the-directionality-9">the directionality</a> of
                   1015:    the element along with the value, the <code title="attr-textarea-dirname"><a href="#attr-textarea-dirname" id="dirname-27">dirname</a></code> attribute can be
                   1016:    specified:</p>
                   1017: 
                   1018:    <pre>&lt;p&gt;If you have any comments, please let us know (you may use either English or Hebrew for your comments):
                   1019: &lt;textarea cols=80 name=comments dirname=comments.dir&gt;&lt;/textarea&gt;&lt;/p&gt;</pre>
                   1020: 
1.202     mike     1021:   </div><h4 id="the-keygen-element"><span class="secno">4.10.14 </span>The <dfn><code>keygen</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.321     mike     1022:    <dd><a href="content-models.html#flow-content" id="flow-content-129">Flow content</a>.</dd>
                   1023:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-143">Phrasing content</a>.</dd>
1.156     mike     1024:    <dd><a href="content-models.html#interactive-content" id="interactive-content-18">Interactive content</a>.</dd>
1.202     mike     1025:    <dd><a href="forms.html#category-listed" id="category-listed-8" title="category-listed">Listed</a>, <a href="forms.html#category-label" id="category-label-6" title="category-label">labelable</a>, <a href="forms.html#category-submit" id="category-submit-7" title="category-submit">submittable</a>, and <a href="forms.html#category-reset" id="category-reset-4" title="category-reset">resettable</a> <a href="forms.html#form-associated-element" id="form-associated-element-12">form-associated element</a>.</dd>
1.203     mike     1026:    <dt>Contexts in which this element can be used:</dt>
1.321     mike     1027:    <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content-144">phrasing content</a> is expected.</dd>
1.9       mike     1028:    <dt>Content model:</dt>
                   1029:    <dd>Empty.</dd>
                   1030:    <dt>Content attributes:</dt>
1.321     mike     1031:    <dd><a href="elements.html#global-attributes" id="global-attributes-94">Global attributes</a></dd>
1.156     mike     1032:    <dd><code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus-7">autofocus</a></code></dd>
                   1033:    <dd><code title="attr-keygen-challenge"><a href="#attr-keygen-challenge" id="challenge">challenge</a></code></dd>
                   1034:    <dd><code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled-18">disabled</a></code></dd>
1.262     mike     1035:    <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-55">form</a></code></dd>
1.156     mike     1036:    <dd><code title="attr-keygen-keytype"><a href="#attr-keygen-keytype" id="keytype">keytype</a></code></dd>
                   1037:    <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-43">name</a></code></dd>
1.9       mike     1038:    <dt>DOM interface:</dt>
                   1039:    <dd>
1.321     mike     1040: <pre class="idl">interface <dfn id="htmlkeygenelement">HTMLKeygenElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-105">HTMLElement</a> {
1.162     mike     1041:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-autofocus" title='Read about this "autofocus" reference in the full HTML5 spec.'>autofocus</a>;
                   1042:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-keygen-challenge" title='Read about this "challenge" reference in the full HTML5 spec.'>challenge</a>;
                   1043:            attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-disabled" title='Read about this "disabled" reference in the full HTML5 spec.'>disabled</a>;
                   1044:   readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement-9">HTMLFormElement</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fae-form" title='Read about this "form" reference in the full HTML5 spec.'>form</a>;
                   1045:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-keygen-keytype" title='Read about this "keytype" reference in the full HTML5 spec.'>keytype</a>;
                   1046:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-name" title='Read about this "name" reference in the full HTML5 spec.'>name</a>;
                   1047: 
                   1048:   readonly attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-keygen-type" title='Read about this "type" reference in the full HTML5 spec.'>type</a>;
                   1049: 
                   1050:   readonly attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-willvalidate" title='Read about this "willValidate" reference in the full HTML5 spec.'>willValidate</a>;
                   1051:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#validitystate" title='Read about this "ValidityState" reference in the full HTML5 spec.'>ValidityState</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validity" title='Read about this "validity" reference in the full HTML5 spec.'>validity</a>;
                   1052:   readonly attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validationmessage" title='Read about this "validationMessage" reference in the full HTML5 spec.'>validationMessage</a>;
                   1053:   boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-checkvalidatity" title='Read about this "checkValidity" reference in the full HTML5 spec.'>checkValidity</a>();
                   1054:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title='Read about this "setCustomValidity" reference in the full HTML5 spec.'>setCustomValidity</a>(in DOMString error);
1.9       mike     1055: 
1.162     mike     1056:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#nodelist" title='Read about this "NodeList" reference in the full HTML5 spec.'>NodeList</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/forms.html#dom-lfe-labels" title='Read about this "labels" reference in the full HTML5 spec.'>labels</a>;
1.9       mike     1057: };</pre>
                   1058:    </dd>
1.190     mike     1059:   </dl><p>The <code><a href="#the-keygen-element" id="keygen-12">keygen</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a key
1.9       mike     1060:   pair generator control. When the control's form is submitted, the
                   1061:   private key is stored in the local keystore, and the public key is
1.160     mike     1062:   packaged and sent to the server.<p>The <dfn id="attr-keygen-challenge" title="attr-keygen-challenge"><code>challenge</code></dfn> attribute
1.9       mike     1063:   may be specified. Its value will be packaged with the submitted
1.160     mike     1064:   key.<p>The <dfn id="attr-keygen-keytype" title="attr-keygen-keytype"><code>keytype</code></dfn>
1.304     mike     1065:   attribute is an <a href="common-microsyntaxes.html#enumerated-attribute" id="enumerated-attribute-11">enumerated attribute</a>. The following
1.160     mike     1066:   table lists the keywords and states for the attribute &mdash; the
1.9       mike     1067:   keywords in the left column map to the states listed in the cell in
                   1068:   the second column on the same row as the keyword. User agents are
1.26      mike     1069:   not required to support these values, and must only recognize values
1.160     mike     1070:   whose corresponding algorithms they support.<table><thead><tr><th> Keyword <th> State
                   1071:    <tbody><tr><td> <code title="">rsa</code>
                   1072:      <td> <i title="">RSA</i>
1.9       mike     1073: <!-- v2 (see below)
                   1074:     <tr>
                   1075:      <td> <code title="">ec</code>
                   1076:      <td> <i title="">EC</i>
                   1077: -->
1.160     mike     1078:   </table><p>The <i>invalid value default</i> state is the <i title="">unknown</i> state. The <i>missing value default</i> state
                   1079:   is the <i title="">RSA</i> state, if it is supported, or the <i title="">unknown</i> state otherwise.<p class="note">This specification does not specify what key types
                   1080:   user agents are to support &mdash; it is possible for a user agent
1.262     mike     1081:   to not support any key types at all.<p>The <code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-56">form</a></code> attribute is used to
1.190     mike     1082:   explicitly associate the <code><a href="#the-keygen-element" id="keygen-13">keygen</a></code> element with its
1.156     mike     1083:   <a href="association-of-controls-and-forms.html#form-owner" id="form-owner-11">form owner</a>. The <code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-44">name</a></code>
                   1084:   attribute represents the element's name. The <code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled-19">disabled</a></code> attribute is used to make
1.9       mike     1085:   the control non-interactive and to prevent its value from being
1.156     mike     1086:   submitted. The <code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus-8">autofocus</a></code>
1.160     mike     1087:   attribute controls focus.<dl class="domintro"><dt><var title="">keygen</var> . <code title="attr-keygen-type">type</code></dt>
1.9       mike     1088: 
                   1089:    <dd>
                   1090: 
                   1091:     <p>Returns the string "<code title="">keygen</code>".</p>
                   1092: 
                   1093:    </dd>
                   1094: 
                   1095:   </dl><p class="note">This specification does not specify how the private
                   1096:   key generated is to be used. It is expected that after receiving the
1.162     mike     1097:   <code><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#signedpublickeyandchallenge" title='Read about this "SignedPublicKeyAndChallenge" reference in the full HTML5 spec.'>SignedPublicKeyAndChallenge</a></code> (SPKAC) structure, the
1.9       mike     1098:   server will generate a client certificate and offer it back to the
                   1099:   user for download; this certificate, once downloaded and stored in
                   1100:   the key store along with the private key, can then be used to
1.88      mike     1101:   authenticate to services that use TLS and certificate
1.9       mike     1102:   authentication.</p><!-- how does the UA know which private key is associated with a
                   1103:   certificate it gets back after the server has taken the public key
                   1104:   created by <keygen> and turned it into a client cert? --><div class="example">
                   1105: 
                   1106:    <p>To generate a key pair, add the private key to the user's key
                   1107:    store, and submit the public key to the server, markup such as the
                   1108:    following can be used:</p>
                   1109: 
1.22      mike     1110:    <pre>&lt;form action="processkey.cgi" method="post" enctype="multipart/form-data"&gt;
1.9       mike     1111:  &lt;p&gt;&lt;keygen name="key"&gt;&lt;/p&gt;
                   1112:  &lt;p&gt;&lt;input type=submit value="Submit key..."&gt;&lt;/p&gt;
                   1113: &lt;/form&gt;</pre>
                   1114: 
                   1115:    <p>The server will then receive a form submission with a packaged
                   1116:    RSA public key as the value of "<code title="">key</code>". This
                   1117:    can then be used for various purposes, such as generating a client
                   1118:    certificate, as mentioned above.</p>
                   1119: 
1.202     mike     1120:   </div><h4 id="the-output-element"><span class="secno">4.10.15 </span>The <dfn><code>output</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.321     mike     1121:    <dd><a href="content-models.html#flow-content" id="flow-content-130">Flow content</a>.</dd>
                   1122:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-145">Phrasing content</a>.</dd>
1.202     mike     1123:    <dd><a href="forms.html#category-listed" id="category-listed-9" title="category-listed">Listed</a>, <a href="forms.html#category-label" id="category-label-7" title="category-label">labelable</a>, and <a href="forms.html#category-reset" id="category-reset-5" title="category-reset">resettable</a> <a href="forms.html#form-associated-element" id="form-associated-element-13">form-associated element</a>.</dd>
1.203     mike     1124:    <dt>Contexts in which this element can be used:</dt>
1.321     mike     1125:    <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content-146">phrasing content</a> is expected.</dd>
1.9       mike     1126:    <dt>Content model:</dt>
1.321     mike     1127:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-147">Phrasing content</a>.</dd>
1.9       mike     1128:    <dt>Content attributes:</dt>
1.321     mike     1129:    <dd><a href="elements.html#global-attributes" id="global-attributes-95">Global attributes</a></dd>
1.156     mike     1130:    <dd><code title="attr-output-for"><a href="#attr-output-for" id="for-2">for</a></code></dd>
1.262     mike     1131:    <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-57">form</a></code></dd>
1.156     mike     1132:    <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-45">name</a></code></dd>
1.9       mike     1133:    <dt>DOM interface:</dt>
                   1134:    <dd>
1.321     mike     1135: <pre class="idl">interface <dfn id="htmloutputelement">HTMLOutputElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-106">HTMLElement</a> {
                   1136:   [PutForwards=<a class="full-spec-link" href="http://dev.w3.org/html5/spec/common-dom-interfaces.html#dom-domsettabletokenlist-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a>] readonly attribute <a href="urls.html#domsettabletokenlist" id="domsettabletokenlist-7">DOMSettableTokenList</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-output-htmlfor" title='Read about this "htmlFor" reference in the full HTML5 spec.'>htmlFor</a>;
1.162     mike     1137:   readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement-10">HTMLFormElement</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fae-form" title='Read about this "form" reference in the full HTML5 spec.'>form</a>;
                   1138:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fe-name" title='Read about this "name" reference in the full HTML5 spec.'>name</a>;
                   1139: 
                   1140:   readonly attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-output-type" title='Read about this "type" reference in the full HTML5 spec.'>type</a>;
                   1141:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-output-defaultvalue" title='Read about this "defaultValue" reference in the full HTML5 spec.'>defaultValue</a>;
                   1142:            attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-output-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a>;
                   1143: 
                   1144:   readonly attribute boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-willvalidate" title='Read about this "willValidate" reference in the full HTML5 spec.'>willValidate</a>;
                   1145:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#validitystate" title='Read about this "ValidityState" reference in the full HTML5 spec.'>ValidityState</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validity" title='Read about this "validity" reference in the full HTML5 spec.'>validity</a>;
                   1146:   readonly attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-validationmessage" title='Read about this "validationMessage" reference in the full HTML5 spec.'>validationMessage</a>;
                   1147:   boolean <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-checkvalidatity" title='Read about this "checkValidity" reference in the full HTML5 spec.'>checkValidity</a>();
                   1148:   void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title='Read about this "setCustomValidity" reference in the full HTML5 spec.'>setCustomValidity</a>(in DOMString error);
1.11      mike     1149: 
1.162     mike     1150:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#nodelist" title='Read about this "NodeList" reference in the full HTML5 spec.'>NodeList</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/forms.html#dom-lfe-labels" title='Read about this "labels" reference in the full HTML5 spec.'>labels</a>;
1.9       mike     1151: };</pre>
                   1152:    </dd>
1.162     mike     1153:   </dl><p>The <code><a href="#the-output-element" id="output-11">output</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> the result of a
1.160     mike     1154:   calculation.<p>The <dfn id="attr-output-for" title="attr-output-for"><code>for</code></dfn> content
1.9       mike     1155:   attribute allows an explicit relationship to be made between the
                   1156:   result of a calculation and the elements that represent the values
                   1157:   that went into the calculation or that otherwise influenced the
1.156     mike     1158:   calculation. The <code title="attr-output-for"><a href="#attr-output-for" id="for-3">for</a></code> attribute,
1.306     mike     1159:   if specified, must contain a string consisting of an <a href="common-microsyntaxes.html#unordered-set-of-unique-space-separated-tokens" id="unordered-set-of-unique-space-separated-tokens-3">unordered
1.265     mike     1160:   set of unique space-separated tokens</a> that are
                   1161:   <a href="infrastructure.html#case-sensitive" id="case-sensitive-5">case-sensitive</a>, each of which must have the value of an
                   1162:   <a href="elements.html#concept-id" id="concept-id-19" title="concept-id">ID</a> of an element in the same
1.262     mike     1163:   <code><a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#document" title='Read about this "Document" reference in the full HTML5 spec.'>Document</a></code>.<p>The <code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-58">form</a></code> attribute is used to
1.156     mike     1164:   explicitly associate the <code><a href="#the-output-element" id="output-12">output</a></code> element with its
                   1165:   <a href="association-of-controls-and-forms.html#form-owner" id="form-owner-12">form owner</a>. The <code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name-46">name</a></code>
1.162     mike     1166:   attribute represents the element's name.<dl class="domintro"><dt><var title="">output</var> . <code title="dom-output-value"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-output-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a></code> [ = <var title="">value</var> ]</dt>
1.9       mike     1167: 
                   1168:    <dd>
                   1169: 
                   1170:     <p>Returns the element's current value.</p>
                   1171: 
                   1172:     <p>Can be set, to change the value.</p>
                   1173: 
                   1174:    </dd>
                   1175: 
1.162     mike     1176:    <dt><var title="">output</var> . <code title="dom-output-defaultValue"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-output-defaultvalue" title='Read about this "defaultValue" reference in the full HTML5 spec.'>defaultValue</a></code> [ = <var title="">value</var> ]</dt>
1.9       mike     1177: 
                   1178:    <dd>
                   1179: 
                   1180:     <p>Returns the element's current default value.</p>
                   1181: 
                   1182:     <p>Can be set, to change the default value.</p>
                   1183: 
                   1184:    </dd>
                   1185: 
1.162     mike     1186:    <dt><var title="">output</var> . <code title="dom-output-type"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-output-type" title='Read about this "type" reference in the full HTML5 spec.'>type</a></code></dt>
1.9       mike     1187: 
                   1188:    <dd>
                   1189: 
                   1190:     <p>Returns the string "<code title="">output</code>".</p>
                   1191: 
                   1192:    </dd>
                   1193: 
                   1194:   </dl><div class="example">
                   1195: 
1.156     mike     1196:    <p>A simple calculator could use <code><a href="#the-output-element" id="output-13">output</a></code> for its
1.9       mike     1197:    display of calculated results:</p>
                   1198: 
                   1199:    <pre>&lt;form onsubmit="return false"&gt;
                   1200:  &lt;input name=a type=number step=any&gt; +
                   1201:  &lt;input name=b type=number step=any&gt; =
1.32      mike     1202:  &lt;output onforminput="value = a.valueAsNumber + b.valueAsNumber"&gt;&lt;/output&gt;
1.9       mike     1203: &lt;/form&gt;</pre>
                   1204: 
1.202     mike     1205:   </div><h4 id="the-progress-element"><span class="secno">4.10.16 </span>The <dfn><code>progress</code></dfn> element</h4><p class="XXX annotation"><span><a href="http://www.w3.org/html/wg/tracker/issues/96">ISSUE-96</a> (progress) blocks progress to Last Call</span><dl class="element"><dt>Categories</dt>
1.321     mike     1206:    <dd><a href="content-models.html#flow-content" id="flow-content-131">Flow content</a>.</dd>
                   1207:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-148">Phrasing content</a>.</dd>
1.202     mike     1208:    <dd><a href="forms.html#category-label" id="category-label-8" title="category-label">Labelable</a> <a href="forms.html#form-associated-element" id="form-associated-element-14">form-associated element</a>.</dd>
1.203     mike     1209:    <dt>Contexts in which this element can be used:</dt>
1.321     mike     1210:    <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content-149">phrasing content</a> is expected.</dd>
1.11      mike     1211:    <dt>Content model:</dt>
1.321     mike     1212:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-150">Phrasing content</a>, but there must be no <code><a href="#the-progress-element" id="progress-8">progress</a></code> element descendants.</dd>
1.11      mike     1213:    <dt>Content attributes:</dt>
1.321     mike     1214:    <dd><a href="elements.html#global-attributes" id="global-attributes-96">Global attributes</a></dd>
1.255     mike     1215:    <dd><code title="attr-progress-value"><a href="#attr-progress-value" id="value-38">value</a></code></dd>
1.156     mike     1216:    <dd><code title="attr-progress-max"><a href="#attr-progress-max" id="max-36">max</a></code></dd>
1.262     mike     1217:    <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-59">form</a></code></dd>
1.11      mike     1218:    <dt>DOM interface:</dt>
                   1219:    <dd>
1.321     mike     1220: <pre class="idl">interface <dfn id="htmlprogresselement">HTMLProgressElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-107">HTMLElement</a> {
1.197     mike     1221:            attribute double <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-progress-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a>;
                   1222:            attribute double <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-progress-max" title='Read about this "max" reference in the full HTML5 spec.'>max</a>;
                   1223:   readonly attribute double <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-progress-position" title='Read about this "position" reference in the full HTML5 spec.'>position</a>;
1.162     mike     1224:   readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement-11">HTMLFormElement</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fae-form" title='Read about this "form" reference in the full HTML5 spec.'>form</a>;
                   1225:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#nodelist" title='Read about this "NodeList" reference in the full HTML5 spec.'>NodeList</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/forms.html#dom-lfe-labels" title='Read about this "labels" reference in the full HTML5 spec.'>labels</a>;
1.11      mike     1226: };</pre>
                   1227:    </dd>
1.162     mike     1228:   </dl><p>The <code><a href="#the-progress-element" id="progress-9">progress</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> the
1.11      mike     1229:   completion progress of a task. The progress is either indeterminate,
                   1230:   indicating that progress is being made but that it is not clear how
1.278     mike     1231:   much more work remains to be done before the task is complete (e.g.
                   1232:   because the task is waiting for a remote host to respond), or the
                   1233:   progress is a number in the range zero to a maximum, giving the
1.160     mike     1234:   fraction of work that has so far been completed.<p>There are two attributes that determine the current task
1.278     mike     1235:   completion represented by the element. The <dfn id="attr-progress-value" title="attr-progress-value"><code>value</code></dfn> attribute
                   1236:   specifies how much of the task has been completed, and the <dfn id="attr-progress-max" title="attr-progress-max"><code>max</code></dfn> attribute specifies
                   1237:   how much work the task requires in total. The units are arbitrary
                   1238:   and not specified.<p>Authors are encouraged to also include the current value and the
1.11      mike     1239:   maximum value inline as text inside the element, so that the
1.160     mike     1240:   progress is made available to users of legacy user agents.<div class="example">
1.11      mike     1241:    <p>Here is a snippet of a Web application that shows the progress
                   1242:    of some automated task:</p>
                   1243:    <pre>&lt;section&gt;
                   1244:  &lt;h2&gt;Task Progress&lt;/h2&gt;
                   1245:  &lt;p&gt;Progress: &lt;progress id="p" max=100&gt;&lt;span&gt;0&lt;/span&gt;%&lt;/progress&gt;&lt;/p&gt;
                   1246:  &lt;script&gt;
                   1247:   var progressBar = document.getElementById('p');
                   1248:   function updateProgress(newValue) {
                   1249:     progressBar.value = newValue;
                   1250:     progressBar.getElementsByTagName('span')[0].textContent = newValue;
                   1251:   }
                   1252:  &lt;/script&gt;
                   1253: &lt;/section&gt;</pre>
                   1254:    <p>(The <code>updateProgress()</code> method in this example would
                   1255:    be called by some other code on the page to update the actual
                   1256:    progress bar as the task progressed.)</p>
1.255     mike     1257:   </div><p>The <code title="attr-progress-value"><a href="#attr-progress-value" id="value-39">value</a></code> and <code title="attr-progress-max"><a href="#attr-progress-max" id="max-37">max</a></code> attributes, when present, must
1.156     mike     1258:   have values that are <a href="common-microsyntaxes.html#valid-floating-point-number" id="valid-floating-point-number-9" title="valid floating point number">valid
1.255     mike     1259:   floating point numbers</a>. The <code title="attr-progress-value"><a href="#attr-progress-value" id="value-40">value</a></code> attribute, if present, must
1.11      mike     1260:   have a value equal to or greater than zero, and less than or equal
1.156     mike     1261:   to the value of the <code title="attr-progress-max"><a href="#attr-progress-max" id="max-38">max</a></code>
                   1262:   attribute, if present, or 1.0, otherwise. The <code title="attr-progress-max"><a href="#attr-progress-max" id="max-39">max</a></code> attribute, if present, must
1.160     mike     1263:   have a value greater than zero.<p class="note">The <code><a href="#the-progress-element" id="progress-10">progress</a></code> element is the wrong
1.11      mike     1264:   element to use for something that is just a gauge, as opposed to
                   1265:   task progress. For instance, indicating disk space usage using
1.156     mike     1266:   <code><a href="#the-progress-element" id="progress-11">progress</a></code> would be inappropriate. Instead, the
1.190     mike     1267:   <code><a href="#the-meter-element" id="meter-8">meter</a></code> element is available for such use cases.<dl class="domintro"><dt><var title="">progress</var> . <code title="dom-progress-position"><a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-progress-position" title='Read about this "position" reference in the full HTML5 spec.'>position</a></code></dt>
1.11      mike     1268: 
                   1269:    <dd>
                   1270: 
                   1271:     <p>For a determinate progress bar (one with known current and
                   1272:     maximum values), returns the result of dividing the current value
                   1273:     by the maximum value.</p>
                   1274: 
1.160     mike     1275:     <p>For an indeterminate progress bar, returns &minus;1.</p>
1.11      mike     1276: 
1.278     mike     1277:    </dd>
                   1278: 
1.351     mike     1279:   </dl><h4 id="the-meter-element"><span class="secno">4.10.17 </span>The <dfn><code>meter</code></dfn> element</h4><!-- Keep this after <progress> and NOT close to <time> --><dl class="element"><dt>Categories</dt>
1.321     mike     1280:    <dd><a href="content-models.html#flow-content" id="flow-content-132">Flow content</a>.</dd>
                   1281:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-151">Phrasing content</a>.</dd>
1.202     mike     1282:    <dd><a href="forms.html#category-label" id="category-label-9" title="category-label">Labelable</a> <a href="forms.html#form-associated-element" id="form-associated-element-15">form-associated element</a>.</dd>
1.203     mike     1283:    <dt>Contexts in which this element can be used:</dt>
1.321     mike     1284:    <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content-152">phrasing content</a> is expected.</dd>
1.11      mike     1285:    <dt>Content model:</dt>
1.321     mike     1286:    <dd><a href="content-models.html#phrasing-content" id="phrasing-content-153">Phrasing content</a>, but there must be no <code><a href="#the-meter-element" id="meter-9">meter</a></code> element descendants.</dd>
1.11      mike     1287:    <dt>Content attributes:</dt>
1.321     mike     1288:    <dd><a href="elements.html#global-attributes" id="global-attributes-97">Global attributes</a></dd>
1.255     mike     1289:    <dd><code title="attr-meter-value"><a href="#attr-meter-value" id="value-42">value</a></code></dd>
1.156     mike     1290:    <dd><code title="attr-meter-min"><a href="#attr-meter-min" id="min-38">min</a></code></dd>
                   1291:    <dd><code title="attr-meter-max"><a href="#attr-meter-max" id="max-41">max</a></code></dd>
                   1292:    <dd><code title="attr-meter-low"><a href="#attr-meter-low" id="low">low</a></code></dd>
                   1293:    <dd><code title="attr-meter-high"><a href="#attr-meter-high" id="high">high</a></code></dd>
                   1294:    <dd><code title="attr-meter-optimum"><a href="#attr-meter-optimum" id="optimum">optimum</a></code></dd>
1.262     mike     1295:    <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-60">form</a></code></dd>
1.11      mike     1296:    <dt>DOM interface:</dt>
                   1297:    <dd>
1.321     mike     1298: <pre class="idl">interface <dfn id="htmlmeterelement">HTMLMeterElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement-108">HTMLElement</a> {
1.197     mike     1299:            attribute double <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-meter-value" title='Read about this "value" reference in the full HTML5 spec.'>value</a>;
                   1300:            attribute double <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-meter-min" title='Read about this "min" reference in the full HTML5 spec.'>min</a>;
                   1301:            attribute double <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-meter-max" title='Read about this "max" reference in the full HTML5 spec.'>max</a>;
                   1302:            attribute double <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-meter-low" title='Read about this "low" reference in the full HTML5 spec.'>low</a>;
                   1303:            attribute double <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-meter-high" title='Read about this "high" reference in the full HTML5 spec.'>high</a>;
                   1304:            attribute double <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-meter-optimum" title='Read about this "optimum" reference in the full HTML5 spec.'>optimum</a>;
1.162     mike     1305:   readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement-12">HTMLFormElement</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-fae-form" title='Read about this "form" reference in the full HTML5 spec.'>form</a>;
                   1306:   readonly attribute <a class="full-spec-link" href="http://dev.w3.org/html5/spec/infrastructure.html#nodelist" title='Read about this "NodeList" reference in the full HTML5 spec.'>NodeList</a> <a class="full-spec-link" href="http://dev.w3.org/html5/spec/forms.html#dom-lfe-labels" title='Read about this "labels" reference in the full HTML5 spec.'>labels</a>;
1.11      mike     1307: };</pre>
                   1308:    </dd>
1.190     mike     1309:   </dl><p>The <code><a href="#the-meter-element" id="meter-10">meter</a></code> element <a class="full-spec-link" href="http://dev.w3.org/html5/spec/rendering.html#represents" title='Read about this "represents" reference in the full HTML5 spec.'>represents</a> a scalar
1.11      mike     1310:   measurement within a known range, or a fractional value; for example
                   1311:   disk usage, the relevance of a query result, or the fraction of a
1.190     mike     1312:   voting population to have selected a particular candidate.<p>This is also known as a gauge.<p class="note">The <code><a href="#the-meter-element" id="meter-11">meter</a></code> element should not be used to
1.11      mike     1313:   indicate progress (as in a progress bar). For that role, HTML
1.190     mike     1314:   provides a separate <code><a href="#the-progress-element" id="progress-12">progress</a></code> element.<p class="note">The <code><a href="#the-meter-element" id="meter-12">meter</a></code> element also does not
1.160     mike     1315:   represent a scalar value of arbitrary range &mdash; for example, it
1.11      mike     1316:   would be wrong to use this to report a weight, or height, unless
1.160     mike     1317:   there is a known maximum value.<p>There are six attributes that determine the semantics of the
                   1318:   gauge represented by the element.<p>The <dfn id="attr-meter-min" title="attr-meter-min"><code>min</code></dfn> attribute
1.11      mike     1319:   specifies the lower bound of the range, and the <dfn id="attr-meter-max" title="attr-meter-max"><code>max</code></dfn> attribute specifies
                   1320:   the upper bound. The <dfn id="attr-meter-value" title="attr-meter-value"><code>value</code></dfn> attribute
                   1321:   specifies the value to have the gauge indicate as the "measured"
1.160     mike     1322:   value.<p>The other three attributes can be used to segment the gauge's
1.11      mike     1323:   range into "low", "medium", and "high" parts, and to indicate which
                   1324:   part of the gauge is the "optimum" part. The <dfn id="attr-meter-low" title="attr-meter-low"><code>low</code></dfn> attribute specifies
                   1325:   the range that is considered to be the "low" part, and the <dfn id="attr-meter-high" title="attr-meter-high"><code>high</code></dfn> attribute specifies
                   1326:   the range that is considered to be the "high" part. The <dfn id="attr-meter-optimum" title="attr-meter-optimum"><code>optimum</code></dfn> attribute
                   1327:   gives the position that is "optimum"; if that is higher than the
                   1328:   "high" value  then this indicates that the higher the value, the
                   1329:   better; if it's lower than the "low" mark then it indicates that
                   1330:   lower values are better, and naturally if it is in between then it
1.255     mike     1331:   indicates that neither high nor low values are good.<p> The <code title="attr-meter-value"><a href="#attr-meter-value" id="value-43">value</a></code> attribute must be
                   1332:   specified. The <code title="attr-meter-value"><a href="#attr-meter-value" id="value-44">value</a></code>, <code title="attr-meter-min"><a href="#attr-meter-min" id="min-39">min</a></code>, <code title="attr-meter-low"><a href="#attr-meter-low" id="low-0">low</a></code>, <code title="attr-meter-high"><a href="#attr-meter-high" id="high-0">high</a></code>, <code title="attr-meter-max"><a href="#attr-meter-max" id="max-42">max</a></code>, and <code title="attr-meter-optimum"><a href="#attr-meter-optimum" id="optimum-0">optimum</a></code> attributes, when present,
1.156     mike     1333:   must have values that are <a href="common-microsyntaxes.html#valid-floating-point-number" id="valid-floating-point-number-10" title="valid floating point
1.255     mike     1334:   number">valid floating point numbers</a>.<p>In addition, the attributes' values are further constrained:<p>Let <var title="">value</var> be the <code title="attr-meter-value"><a href="#attr-meter-value" id="value-45">value</a></code> attribute's number.<p>If the <code title="attr-meter-min"><a href="#attr-meter-min" id="min-40">min</a></code> attribute
1.11      mike     1335:   attribute is specified, then let <var title="">minimum</var> be that
1.160     mike     1336:   attribute's value; otherwise, let it be zero.<p>If the <code title="attr-meter-max"><a href="#attr-meter-max" id="max-43">max</a></code> attribute
1.11      mike     1337:   attribute is specified, then let <var title="">maximum</var> be that
1.160     mike     1338:   attribute's value; otherwise, let it be 1.0.<p>The following inequalities must hold, as applicable:<ul class="brief"><li><var title="">minimum</var> &le; <var title="">value</var> &le; <var title="">maximum</var></li>
                   1339:    <li><var title="">minimum</var> &le; <code title="attr-meter-low"><a href="#attr-meter-low" id="low-1">low</a></code> &le; <var title="">maximum</var> (if <code title="attr-meter-low"><a href="#attr-meter-low" id="low-2">low</a></code> is specified)</li>
                   1340:    <li><var title="">minimum</var> &le; <code title="attr-meter-high"><a href="#attr-meter-high" id="high-1">high</a></code> &le; <var title="">maximum</var> (if <code title="attr-meter-high"><a href="#attr-meter-high" id="high-2">high</a></code> is specified)</li>
                   1341:    <li><var title="">minimum</var> &le; <code title="attr-meter-optimum"><a href="#attr-meter-optimum" id="optimum-1">optimum</a></code> &le; <var title="">maximum</var> (if <code title="attr-meter-optimum"><a href="#attr-meter-optimum" id="optimum-2">optimum</a></code> is specified)</li>
                   1342:    <li><code title="attr-meter-low"><a href="#attr-meter-low" id="low-3">low</a></code> &le; <code title="attr-meter-high"><a href="#attr-meter-high" id="high-3">high</a></code> (if both <code title="attr-meter-low"><a href="#attr-meter-low" id="low-4">low</a></code> and <code title="attr-meter-high"><a href="#attr-meter-high" id="high-4">high</a></code> are specified)</li>
1.21      mike     1343:   </ul><p class="note">If no minimum or maximum is specified, then the
1.11      mike     1344:   range is assumed to be 0..1, and the value thus has to be within
1.160     mike     1345:   that range.<p>Authors are encouraged to include a textual representation of the
1.11      mike     1346:   gauge's state in the element's contents, for users of user agents
1.190     mike     1347:   that do not support the <code><a href="#the-meter-element" id="meter-13">meter</a></code> element.<div class="example">
1.11      mike     1348: 
                   1349:    <p>The following examples show three gauges that would all be
                   1350:    three-quarters full:</p>
                   1351: 
                   1352:    <pre>Storage space usage: &lt;meter value=6 max=8&gt;6 blocks used (out of 8 total)&lt;/meter&gt;
                   1353: Voter turnout: &lt;meter value=0.75&gt;&lt;img alt="75%" src="graph75.png"&gt;&lt;/meter&gt;
                   1354: Tickets sold: &lt;meter min="0" max="100" value="75"&gt;&lt;/meter&gt;</pre>
                   1355: 
                   1356:    <p>The following example is incorrect use of the element, because
                   1357:    it doesn't give a range (and since the default maximum is 1, both
                   1358:    of the gauges would end up looking maxed out):</p>
                   1359: 
                   1360:    <pre class="bad">&lt;p&gt;The grapefruit pie had a radius of &lt;meter value=12&gt;12cm&lt;/meter&gt;
                   1361: and a height of &lt;meter value=2&gt;2cm&lt;/meter&gt;.&lt;/p&gt; &lt;!-- <strong>BAD!</strong> --&gt;</pre>
                   1362: 
                   1363:    <p>Instead, one would either not include the meter element, or use
                   1364:    the meter element with a defined range to give the dimensions in
                   1365:    context compared to other pies:</p>
                   1366: 
                   1367:    <pre>&lt;p&gt;The grapefruit pie had a radius of 12cm and a height of
                   1368: 2cm.&lt;/p&gt;
                   1369: &lt;dl&gt;
                   1370:  &lt;dt&gt;Radius: &lt;dd&gt; &lt;meter min=0 max=20 value=12&gt;12cm&lt;/meter&gt;
                   1371:  &lt;dt&gt;Height: &lt;dd&gt; &lt;meter min=0 max=10 value=2&gt;2cm&lt;/meter&gt;
                   1372: &lt;/dl&gt;</pre>
                   1373: 
                   1374:   </div><p>There is no explicit way to specify units in the
1.190     mike     1375:   <code><a href="#the-meter-element" id="meter-14">meter</a></code> element, but the units may be specified in the
1.160     mike     1376:   <code title="attr-title"><a href="elements.html#the-title-attribute" id="title-27">title</a></code> attribute in free-form text.<div class="example">
1.11      mike     1377: 
                   1378:    <p>The example above could be extended to mention the units:</p>
                   1379: 
                   1380:    <pre>&lt;dl&gt;
                   1381:  &lt;dt&gt;Radius: &lt;dd&gt; &lt;meter min=0 max=20 value=12 title="centimeters"&gt;12cm&lt;/meter&gt;
                   1382:  &lt;dt&gt;Height: &lt;dd&gt; &lt;meter min=0 max=10 value=2 title="centimeters"&gt;2cm&lt;/meter&gt;
                   1383: &lt;/dl&gt;</pre>
                   1384: 
                   1385:   </div><div class="example">
                   1386:    <p>The following markup:</p>
                   1387:    <pre>&lt;h3&gt;Suggested groups&lt;/h3&gt;
                   1388: &lt;menu type="toolbar"&gt;
                   1389:  &lt;a href="?cmd=hsg" onclick="hideSuggestedGroups()"&gt;Hide suggested groups&lt;/a&gt;
                   1390: &lt;/menu&gt;
                   1391: &lt;ul&gt;
                   1392:  &lt;li&gt;
                   1393:   &lt;p&gt;&lt;a href="/group/comp.infosystems.www.authoring.stylesheets/view"&gt;comp.infosystems.www.authoring.stylesheets&lt;/a&gt; -
                   1394:      &lt;a href="/group/comp.infosystems.www.authoring.stylesheets/subscribe"&gt;join&lt;/a&gt;&lt;/p&gt;
                   1395:   &lt;p&gt;Group description: &lt;strong&gt;Layout/presentation on the WWW.&lt;/strong&gt;&lt;/p&gt;
                   1396:   &lt;p&gt;<strong>&lt;meter value="0.5"&gt;Moderate activity,&lt;/meter&gt;</strong> Usenet, 618 subscribers&lt;/p&gt;
                   1397:  &lt;/li&gt;
                   1398:  &lt;li&gt;
                   1399:   &lt;p&gt;&lt;a href="/group/netscape.public.mozilla.xpinstall/view"&gt;netscape.public.mozilla.xpinstall&lt;/a&gt; -
                   1400:      &lt;a href="/group/netscape.public.mozilla.xpinstall/subscribe"&gt;join&lt;/a&gt;&lt;/p&gt;
                   1401:   &lt;p&gt;Group description: &lt;strong&gt;Mozilla XPInstall discussion.&lt;/strong&gt;&lt;/p&gt;
                   1402:   &lt;p&gt;<strong>&lt;meter value="0.25"&gt;Low activity,&lt;/meter&gt;</strong> Usenet, 22 subscribers&lt;/p&gt;
                   1403:  &lt;/li&gt;
                   1404:  &lt;li&gt;
                   1405:   &lt;p&gt;&lt;a href="/group/mozilla.dev.general/view"&gt;mozilla.dev.general&lt;/a&gt; -
                   1406:      &lt;a href="/group/mozilla.dev.general/subscribe"&gt;join&lt;/a&gt;&lt;/p&gt;
                   1407:   &lt;p&gt;<strong>&lt;meter value="0.25"&gt;Low activity,&lt;/meter&gt;</strong> Usenet, 66 subscribers&lt;/p&gt;
                   1408:  &lt;/li&gt;
                   1409: &lt;/ul&gt;</pre>
                   1410:    <p>Might be rendered as follows:</p>
1.203     mike     1411:    <p><img alt="With the <meter> elements rendered as inline green bars of varying lengths." height="178" src="http://dev.w3.org/html5/spec/images/sample-meter.png" width="332"></p>
1.13      mike     1412:   </div><p>User agents  combine the value of
1.156     mike     1413:   the <code title="attr-title"><a href="elements.html#the-title-attribute" id="title-28">title</a></code> attribute and the other
1.11      mike     1414:   attributes to provide context-sensitive help or inline text
1.160     mike     1415:   detailing the actual values.<div class="example">
1.11      mike     1416:    <p>For example, the following snippet:</p>
                   1417:    <pre>&lt;meter min=0 max=60 value=23.2 title=seconds&gt;&lt;/meter&gt;</pre>
                   1418:    <p>...might cause the user agent to display a gauge with a tooltip
                   1419:    saying "Value: 23.2 out of 60." on one line and "seconds" on a
                   1420:    second line.</p>
1.262     mike     1421:   </div><p>The <code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form-61">form</a></code> attribute is used to
1.190     mike     1422:   explicitly associate the <code><a href="#the-meter-element" id="meter-15">meter</a></code> element with its
1.160     mike     1423:   <a href="association-of-controls-and-forms.html#form-owner" id="form-owner-13">form owner</a>.<div class="example">
1.11      mike     1424: 
                   1425:    <p>The following example shows how a gauge could fall back to
                   1426:    localized or pretty-printed text.</p>
                   1427: 
1.160     mike     1428:    <pre>&lt;p&gt;Disk usage: &lt;meter min=0 value=170261928 max=233257824&gt;170&thinsp;261&thinsp;928 bytes used
                   1429: out of 233&thinsp;257&thinsp;824 bytes available&lt;/meter&gt;&lt;/p&gt;</pre>
1.11      mike     1430: 
1.160     mike     1431:   </div>

Webmaster