Annotation of html5/spec-author-view/the-button-element.html, revision 1.551
1.474 mike 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html lang="en-US-x-Hixie"><meta content="text/html; charset=utf-8" http-equiv="Content-Type"><title>4.10.8 The button element — HTML5 (Edition for Web Authors)</title><meta content="width=device-width;" name="viewport"><link href="whatwg.css" rel="stylesheet"><style type="text/css">
1.1 mike 2: pre { margin-left: 2em; white-space: pre-wrap; }
3: h2 { margin: 3em 0 1em 0; }
4: h3 { margin: 2.5em 0 1em 0; }
5: h4 { margin: 2.5em 0 0.75em 0; }
6: h5, h6 { margin: 2.5em 0 1em; }
7: h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
8: h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
9: p { margin: 1em 0; }
10: hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
11: dl, dd { margin-top: 0; margin-bottom: 0; }
12: dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
13: dt + dt { margin-top: 0; }
14: dd dt { margin-top: 0.25em; margin-bottom: 0; }
15: dd p { margin-top: 0; }
16: dd dl + p { margin-top: 1em; }
17: dd table + p { margin-top: 1em; }
18: p + * > li, dd li { margin: 1em 0; }
19: dt, dfn { font-weight: bold; font-style: normal; }
20: dt dfn { font-style: italic; }
21: pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
22: pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
23: pre em { font-weight: bolder; font-style: normal; }
24: @media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
25: var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
26: table { border-collapse: collapse; border-style: hidden hidden none hidden; }
1.34 mike 27: table thead, table tbody { border-bottom: solid; }
1.1 mike 28: table tbody th:first-child { border-left: solid; }
29: table tbody th { text-align: left; }
30: table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
31: blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }
32:
33: .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
34: .matrix, .matrix td { border: none; text-align: right; }
35: .matrix { margin-left: 2em; }
36: .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
37: .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
38: .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
39:
40: .toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
41: img.extra { float: right; }
42: pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; }
43: pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
44: pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
45: pre.css:first-line { color: #AAAA50; }
1.23 mike 46: dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
1.1 mike 47: hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
48: dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
49: dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
50: dl.domintro dd p { margin: 0.5em 0; }
51: dl.switch { padding-left: 2em; }
52: dl.switch > dt { text-indent: -1.5em; }
53: dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
54: dl.triple { padding: 0 0 0 1em; }
55: dl.triple dt, dl.triple dd { margin: 0; display: inline }
56: dl.triple dt:after { content: ':'; }
57: dl.triple dd:after { content: '\A'; white-space: pre; }
58: .diff-old { text-decoration: line-through; color: silver; background: transparent; }
59: .diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
60: a .diff-new { border-bottom: 1px blue solid; }
61:
62: h2 { page-break-before: always; }
63: h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
64: h1 + h2, hr + h2.no-toc { page-break-before: auto; }
65:
1.306 mike 66: p > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]),
67: li > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]), { border-bottom: solid #9999CC; }
1.1 mike 68:
69: div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
70: div.head p { margin: 0; }
71: div.head h1 { margin: 0; }
72: div.head .logo { float: right; margin: 0 1em; }
73: div.head .logo img { border: none } /* remove border from top image */
74: div.head dl { margin: 1em 0; }
75: div.head p.copyright, div.head p.alt { font-size: x-small; font-style: oblique; margin: 0; }
76:
77: body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
78: body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
79: body > .toc > li > * { margin-bottom: 0.5em; }
80: body > .toc > li > * > li > * { margin-bottom: 0.25em; }
81: .toc, .toc li { list-style: none; }
82:
83: .brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
84: .brief li { margin: 0; padding: 0; }
85: .brief li p { margin: 0; padding: 0; }
86:
87: .category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
88: .category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
89: .category-list li { display: inline; }
90: .category-list li:not(:last-child)::after { content: ', '; }
91: .category-list li > span, .category-list li > a { text-transform: lowercase; }
92: .category-list li * { text-transform: none; } /* don't affect <code> nested in <a> */
93:
94: .XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
95: .XXX > :first-child { margin-top: 0; }
96: p .XXX { line-height: 3em; }
97: .annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
98: .annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
99: .annotation :link, .annotation :visited { color: inherit; }
100: .annotation :link:hover, .annotation :visited:hover { background: transparent; }
101: .annotation span { border: none ! important; }
102: .note { color: green; background: transparent; font-family: sans-serif; }
103: .warning { color: red; background: transparent; }
104: .note, .warning { font-weight: bolder; font-style: italic; }
105: p.note, div.note { padding: 0.5em 2em; }
106: span.note { padding: 0 2em; }
107: .note p:first-child, .warning p:first-child { margin-top: 0; }
108: .note p:last-child, .warning p:last-child { margin-bottom: 0; }
109: .warning:before { font-style: normal; }
110: p.note:before { content: 'Note: '; }
111: p.warning:before { content: '\26A0 Warning! '; }
112:
113: .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
114: .bookkeeping { font-size: 0.8em; margin: 2em 0; }
115: .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }
1.132 mike 116: .bookkeeping dt { margin: 0.5em 2em 0; }
117: .bookkeeping dd { margin: 0 3em 0.5em; }
1.1 mike 118:
119: h4 { position: relative; z-index: 3; }
120: h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
121: .element {
122: background: #EEEEFF;
123: color: black;
124: margin: 0 0 1em 0.15em;
125: padding: 0 1em 0.25em 0.75em;
126: border-left: solid #9999FF 0.25em;
127: position: relative;
128: z-index: 1;
129: }
130: .element:before {
131: position: absolute;
132: z-index: 2;
133: top: 0;
134: left: -1.15em;
135: height: 2em;
136: width: 0.9em;
137: background: #EEEEFF;
138: content: ' ';
139: border-style: none none solid solid;
140: border-color: #9999FF;
141: border-width: 0.25em;
142: }
143:
144: .example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; }
145: td > .example:only-child { margin: 0 0 0 0.1em; }
146:
147: ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
148: ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
149: ul.domTree li li { list-style: none; }
150: 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; }
151: 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; }
152: ul.domTree span { font-style: italic; font-family: serif; }
153: ul.domTree .t1 code { color: purple; font-weight: bold; }
154: ul.domTree .t2 { font-style: normal; font-family: monospace; }
155: ul.domTree .t2 .name { color: black; font-weight: bold; }
156: ul.domTree .t2 .value { color: blue; font-weight: normal; }
157: ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
158: ul.domTree .t7 code, .domTree .t8 code { color: green; }
159: ul.domTree .t10 code { color: teal; }
160:
1.14 mike 161: body.dfnEnabled dfn { cursor: pointer; }
162: .dfnPanel {
163: display: inline;
164: position: absolute;
165: z-index: 10;
166: height: auto;
167: width: auto;
168: padding: 0.5em 0.75em;
169: font: small sans-serif, Droid Sans Fallback;
170: background: #DDDDDD;
171: color: black;
172: border: outset 0.2em;
173: }
174: .dfnPanel * { margin: 0; padding: 0; font: inherit; text-indent: 0; }
175: .dfnPanel :link, .dfnPanel :visited { color: black; }
176: .dfnPanel p { font-weight: bolder; }
177: .dfnPanel * + p { margin-top: 0.25em; }
178: .dfnPanel li { list-style-position: inside; }
179:
1.1 mike 180: #configUI { position: absolute; z-index: 20; top: 10em; right: 1em; width: 11em; font-size: small; }
181: #configUI p { margin: 0.5em 0; padding: 0.3em; background: #EEEEEE; color: black; border: inset thin; }
182: #configUI p label { display: block; }
183: #configUI #updateUI, #configUI .loginUI { text-align: center; }
184: #configUI input[type=button] { display: block; margin: auto; }
1.121 mike 185:
1.321 mike 186: fieldset { margin: 1em; padding: 0.5em 1em; }
187: fieldset > legend + * { margin-top: 0; }
1.293 mike 188: fieldset > :last-child { margin-bottom: 0; }
1.321 mike 189: fieldset p { margin: 0.5em 0; }
190:
1.502 mike 191: </style><link href="http://www.w3.org/StyleSheets/TR/W3C-ED" rel="stylesheet" type="text/css"><link href="style.css" rel="stylesheet"><script src="link-fixup.js" type="text/javascript"></script><style type="text/css">
1.1 mike 192:
193: .applies thead th > * { display: block; }
194: .applies thead code { display: block; }
195: .applies tbody th { whitespace: nowrap; }
196: .applies td { text-align: center; }
197: .applies .yes { background: yellow; }
198:
1.136 mike 199: .matrix, .matrix td { border: hidden; text-align: right; }
1.1 mike 200: .matrix { margin-left: 2em; }
201:
202: .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
203: .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
204: .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
205:
1.213 mike 206: td.eg { border-width: thin; text-align: center; }
207:
1.1 mike 208: #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
209: #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
210: #table-example-1 caption { padding-bottom: 0.5em; }
211: #table-example-1 thead, #table-example-1 tbody { border: none; }
212: #table-example-1 th, #table-example-1 td { border: solid thin; }
213: #table-example-1 th { font-weight: normal; }
214: #table-example-1 td { border-style: none solid; vertical-align: top; }
215: #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
216: #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
217: #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
218: #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
219: #table-example-1 tbody td:first-child::after { content: leader(". "); }
220: #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
221: #table-example-1 tbody td:first-child + td { width: 10em; }
222: #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
223: #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
224:
225: .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
226: .apple-table-examples * { font-family: "Times", serif; }
227: .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
228: .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
229: .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
230: .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
231: .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
232: .apple-table-examples td { text-align: right; vertical-align: top; }
233: .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
1.9 mike 234: .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
235: .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
236: .apple-table-examples sup { line-height: 0; }
237:
1.11 mike 238: .details-example img { vertical-align: top; }
239:
1.386 mike 240: #base64-table {
241: white-space: nowrap;
242: font-size: 0.6em;
243: column-width: 6em;
244: column-count: 5;
245: column-gap: 1em;
246: -moz-column-width: 6em;
247: -moz-column-count: 5;
248: -moz-column-gap: 1em;
249: -webkit-column-width: 6em;
250: -webkit-column-count: 5;
251: -webkit-column-gap: 1em;
252: }
253: #base64-table thead { display: none; }
254: #base64-table * { border: none; }
255: #base64-table tbody td:first-child:after { content: ':'; }
256: #base64-table tbody td:last-child { text-align: right; }
257:
1.26 mike 258: #named-character-references-table {
1.257 mike 259: white-space: nowrap;
1.26 mike 260: font-size: 0.6em;
1.257 mike 261: column-width: 30em;
1.26 mike 262: column-gap: 1em;
1.257 mike 263: -moz-column-width: 30em;
1.26 mike 264: -moz-column-gap: 1em;
1.257 mike 265: -webkit-column-width: 30em;
1.26 mike 266: -webkit-column-gap: 1em;
267: }
1.257 mike 268: #named-character-references-table > table > tbody > tr > td:first-child + td,
1.26 mike 269: #named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
270: #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 271: #named-character-references-table > table > tbody > tr#entity-CounterClockwiseContourIntegral > td:first-child { font-size: 0.5em; }
1.26 mike 272:
1.35 mike 273: .glyph.control { color: red; }
274:
1.38 mike 275: @font-face {
276: font-family: 'Essays1743';
277: src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743.ttf');
278: }
279: @font-face {
280: font-family: 'Essays1743';
281: font-weight: bold;
282: src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Bold.ttf');
283: }
284: @font-face {
285: font-family: 'Essays1743';
286: font-style: italic;
287: src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-Italic.ttf');
288: }
289: @font-face {
290: font-family: 'Essays1743';
291: font-style: italic;
292: font-weight: bold;
293: src: url('http://www.whatwg.org/specs/web-apps/current-work/fonts/Essays1743-BoldItalic.ttf');
294: }
295:
1.425 mike 296: </style><script type="text/javascript">
1.399 mike 297: function getCookie(name) {
298: var params = location.search.substr(1).split("&");
299: for (var index = 0; index < params.length; index++) {
300: if (params[index] == name)
301: return "1";
302: var data = params[index].split("=");
303: if (data[0] == name)
304: return unescape(data[1]);
305: }
306: var cookies = document.cookie.split("; ");
307: for (var index = 0; index < cookies.length; index++) {
308: var data = cookies[index].split("=");
309: if (data[0] == name)
310: return unescape(data[1]);
311: }
312: return null;
313: }
314: function load(script) {
315: var e = document.createElement('script');
316: e.setAttribute('src', script + '?' + encodeURIComponent(location) + '&' + encodeURIComponent(document.referrer));
317: document.body.appendChild(e);
318: }
319: function init() {
320: if (location.search == '?slow-browser')
321: return;
322: var configUI = document.createElement('div');
323: configUI.id = 'configUI';
324: document.body.appendChild(configUI);
325: if (document.getElementById('head'))
326: load('toc.js');
327: load('dfn.js');
328: if (getCookie('profile') == '1')
329: document.getElementsByTagName('h2')[0].textContent += '; load: ' + (new Date() - loadTimer) + 'ms';
330: fixBrokenLink();
331: }
1.478 mike 332: </script><script src="dfn.js" type="text/javascript"></script><link href="common-input-element-attributes.html" rel="prev" title="4.10.7.2 Common input element attributes">
1.160 mike 333: <link href="Overview.html#contents" rel="index" title="Table of contents">
1.551 ! mike 334: <link href="association-of-controls-and-forms.html" rel="next" title="4.10.18 Association of controls and forms">
1.476 mike 335: <body class="split chapter"><div class="head" id="head">
1.469 mike 336: <div aria-haspopup="true" id="jumpIndexA-button" role="button" tabindex="0">jump
1.551 ! mike 337: <div id="jumpIndexA"><ul><li><a class="noindex" href="text-level-semantics.html#the-a-element">a</a><a class="noindex" href="text-level-semantics.html#the-abbr-element">abbr</a><a class="noindex" href="sections.html#the-address-element">address</a><a class="noindex" href="the-map-element.html#the-area-element">area</a><a class="noindex" href="sections.html#the-article-element">article</a><a class="noindex" href="sections.html#the-aside-element">aside</a><a class="noindex" href="the-iframe-element.html#the-audio-element">audio</a></ul><ul><li><a class="noindex" href="text-level-semantics.html#the-b-element">b</a><a class="noindex" href="semantics.html#the-base-element">base</a><a class="noindex" href="text-level-semantics.html#the-bdi-element">bdi</a><a class="noindex" href="text-level-semantics.html#the-bdo-element">bdo</a><a class="noindex" href="grouping-content.html#the-blockquote-element">blockquote</a><a class="noindex" href="sections.html#the-body-element">body</a><a class="noindex" href="text-level-semantics.html#the-br-element">br</a><a class="noindex" href="#the-button-element">button</a></ul><ul><li><a class="noindex" href="the-canvas-element.html#the-canvas-element">canvas</a><a class="noindex" href="tabular-data.html#the-caption-element">caption</a><a class="noindex" href="text-level-semantics.html#the-cite-element">cite</a><a class="noindex" href="text-level-semantics.html#the-code-element">code</a><a class="noindex" href="tabular-data.html#the-col-element">col</a><a class="noindex" href="tabular-data.html#the-colgroup-element">colgroup</a><a class="noindex" href="interactive-elements.html#the-command-element">command</a></ul><ul><li><a class="noindex" href="#the-datalist-element">datalist</a><a class="noindex" href="grouping-content.html#the-dd-element">dd</a><a class="noindex" href="edits.html#the-del-element">del</a><a class="noindex" href="interactive-elements.html#the-details-element">details</a><a class="noindex" href="text-level-semantics.html#the-dfn-element">dfn</a><a class="full-spec-link" href="http://dev.w3.org/html5/spec/.html#the-dir-element" title='Read about this "dir" reference in the full HTML5 spec.'>dir</a><a class="noindex" href="grouping-content.html#the-div-element">div</a><a class="noindex" href="grouping-content.html#the-dl-element">dl</a><a class="noindex" href="grouping-content.html#the-dt-element">dt</a></ul><ul><li><a class="noindex" href="text-level-semantics.html#the-em-element">em</a><a class="noindex" href="the-iframe-element.html#the-embed-element">embed</a><a class="noindex" href="forms.html#the-fieldset-element">fieldset</a><a class="noindex" href="grouping-content.html#the-figcaption-element">figcaption</a><a class="noindex" href="grouping-content.html#the-figure-element">figure</a><a class="noindex" href="sections.html#the-footer-element">footer</a><a class="noindex" href="forms.html#the-form-element">form</a></ul><ul><li><a class="noindex" href="sections.html#the-h1-h2-h3-h4-h5-and-h6-elements">h1</a><a class="noindex" href="sections.html#the-h1-h2-h3-h4-h5-and-h6-elements">h2</a><a class="noindex" href="sections.html#the-h1-h2-h3-h4-h5-and-h6-elements">h3</a><a class="noindex" href="sections.html#the-h1-h2-h3-h4-h5-and-h6-elements">h4</a><a class="noindex" href="sections.html#the-h1-h2-h3-h4-h5-and-h6-elements">h5</a><a class="noindex" href="sections.html#the-h1-h2-h3-h4-h5-and-h6-elements">h6</a><a class="noindex" href="semantics.html#the-head-element">head</a><a class="noindex" href="sections.html#the-header-element">header</a><a class="noindex" href="sections.html#the-hgroup-element">hgroup</a><a class="noindex" href="grouping-content.html#the-hr-element">hr</a><a class="noindex" href="semantics.html#the-html-element">html</a></ul><ul><li><a class="noindex" href="text-level-semantics.html#the-i-element">i</a><a class="noindex" href="the-iframe-element.html#the-iframe-element">iframe</a><a class="noindex" href="embedded-content-1.html#the-img-element">img</a><a class="noindex" href="the-input-element.html#the-input-element">input</a><a class="noindex" href="edits.html#the-ins-element">ins</a><a class="noindex" href="text-level-semantics.html#the-kbd-element">kbd</a><a class="noindex" href="#the-keygen-element">keygen</a></ul><ul><li><a class="noindex" href="forms.html#the-label-element">label</a><a class="noindex" href="forms.html#the-legend-element">legend</a><a class="noindex" href="grouping-content.html#the-li-element">li</a><a class="noindex" href="semantics.html#the-link-element">link</a><a class="noindex" href="the-map-element.html#the-map-element">map</a><a class="noindex" href="text-level-semantics.html#the-mark-element">mark</a><a class="noindex" href="interactive-elements.html#the-menu-element">menu</a><a class="noindex" href="semantics.html#the-meta-element">meta</a><a class="noindex" href="#the-meter-element">meter</a></ul><ul><li><a class="noindex" href="sections.html#the-nav-element">nav</a><a class="noindex" href="scripting-1.html#the-noscript-element">noscript</a><a class="noindex" href="the-iframe-element.html#the-object-element">object</a><a class="noindex" href="grouping-content.html#the-ol-element">ol</a><a class="noindex" href="#the-optgroup-element">optgroup</a><a class="noindex" href="#the-option-element">option</a><a class="noindex" href="#the-output-element">output</a></ul><ul><li><a class="noindex" href="grouping-content.html#the-p-element">p</a><a class="noindex" href="the-iframe-element.html#the-param-element">param</a><a class="noindex" href="grouping-content.html#the-pre-element">pre</a><a class="noindex" href="#the-progress-element">progress</a><a class="noindex" href="text-level-semantics.html#the-q-element">q</a><a class="noindex" href="text-level-semantics.html#the-rp-element">rp</a><a class="noindex" href="text-level-semantics.html#the-rt-element">rt</a><a class="noindex" href="text-level-semantics.html#the-ruby-element">ruby</a></ul><ul><li><a class="noindex" href="text-level-semantics.html#the-s-element">s</a><a class="noindex" href="text-level-semantics.html#the-samp-element">samp</a><a class="noindex" href="scripting-1.html#the-script-element">script</a><a class="noindex" href="sections.html#the-section-element">section</a><a class="noindex" href="#the-select-element">select</a><a class="noindex" href="text-level-semantics.html#the-small-element">small</a><a class="noindex" href="the-iframe-element.html#the-source-element">source</a><a class="noindex" href="text-level-semantics.html#the-span-element">span</a></ul><ul><li><a class="noindex" href="text-level-semantics.html#the-strong-element">strong</a><a class="noindex" href="semantics.html#the-style-element">style</a><a class="noindex" href="text-level-semantics.html#the-sub-and-sup-elements">sub</a><a class="noindex" href="interactive-elements.html#the-summary-element">summary</a><a class="noindex" href="text-level-semantics.html#the-sub-and-sup-elements">sup</a></ul><ul><li><a class="noindex" href="tabular-data.html#the-table-element">table</a><a class="noindex" href="tabular-data.html#the-tbody-element">tbody</a><a class="noindex" href="tabular-data.html#the-td-element">td</a><a class="noindex" href="#the-textarea-element">textarea</a><a class="noindex" href="tabular-data.html#the-tfoot-element">tfoot</a><a class="noindex" href="tabular-data.html#the-th-element">th</a><a class="noindex" href="tabular-data.html#the-thead-element">thead</a><a class="noindex" href="text-level-semantics.html#the-time-element">time</a><a class="noindex" href="semantics.html#the-title-element">title</a></ul><ul><li><a class="noindex" href="tabular-data.html#the-tr-element">tr</a><a class="noindex" href="the-iframe-element.html#the-track-element">track</a><a class="noindex" href="text-level-semantics.html#the-u-element">u</a><a class="noindex" href="grouping-content.html#the-ul-element">ul</a><a class="noindex" href="text-level-semantics.html#the-var-element">var</a><a class="noindex" href="the-iframe-element.html#the-video-element">video</a><a class="noindex" href="text-level-semantics.html#the-wbr-element">wbr</a></ul><ul class="jumpIndexA-other"><li><a class="noindex" href="elements.html#global-attributes">global attributes</a><a class="noindex" href="index-of-terms.html#index-of-terms">terms</a></ul></div></div>
! 338: <script src="jump-indexes.js"></script></div><div>
1.320 mike 339: <a href="common-input-element-attributes.html">← 4.10.7.2 Common input element attributes</a> –
1.160 mike 340: <a href="Overview.html#contents">Table of contents</a> –
1.551 ! mike 341: <a href="association-of-controls-and-forms.html">4.10.18 Association of controls and forms →</a>
! 342: <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 343:
1.455 mike 344: <h4 id="the-button-element"><span class="secno">4.10.8 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>button</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
1.442 mike 345: <dd><a href="content-models.html#flow-content" id="flow-content_125">Flow content</a>.</dd>
1.415 mike 346: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_138">Phrasing content</a>.</dd>
1.516 mike 347: <dd><a href="content-models.html#interactive-content" id="interactive-content_13">Interactive content</a>.</dd>
1.525 mike 348: <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_8">form-associated element</a>.</dd>
1.424 mike 349: <dt>Contexts in which this element can be used:</dt>
1.415 mike 350: <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content_139">phrasing content</a> is expected.</dd>
1.424 mike 351: <dt>Content model:</dt>
1.516 mike 352: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_140">Phrasing content</a>, but there must be no <a href="content-models.html#interactive-content" id="interactive-content_14">interactive content</a> descendant.</dd>
1.424 mike 353: <dt>Content attributes:</dt>
1.551 ! mike 354: <dd><a href="elements.html#global-attributes" id="global-attributes_89">Global attributes</a></dd>
1.415 mike 355: <dd><code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus_1">autofocus</a></code></dd>
356: <dd><code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled_13">disabled</a></code></dd>
357: <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form_49">form</a></code></dd>
358: <dd><code title="attr-fs-formaction"><a href="association-of-controls-and-forms.html#attr-fs-formaction" id="formaction_26">formaction</a></code></dd>
359: <dd><code title="attr-fs-formenctype"><a href="association-of-controls-and-forms.html#attr-fs-formenctype" id="formenctype_26">formenctype</a></code></dd>
360: <dd><code title="attr-fs-formmethod"><a href="association-of-controls-and-forms.html#attr-fs-formmethod" id="formmethod_26">formmethod</a></code></dd>
361: <dd><code title="attr-fs-formnovalidate"><a href="association-of-controls-and-forms.html#attr-fs-formnovalidate" id="formnovalidate_27">formnovalidate</a></code></dd>
362: <dd><code title="attr-fs-formtarget"><a href="association-of-controls-and-forms.html#attr-fs-formtarget" id="formtarget_26">formtarget</a></code></dd>
1.527 mike 363: <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name_36">name</a></code></dd>
1.526 mike 364: <dd><code title="attr-button-type"><a href="#attr-button-type" id="type_78">type</a></code></dd>
1.415 mike 365: <dd><code title="attr-button-value"><a href="#attr-button-value" id="value_30">value</a></code></dd>
1.424 mike 366: <dt>DOM interface:</dt>
1.9 mike 367: <dd>
1.455 mike 368: <pre class="idl">interface <dfn aria-haspopup="true" id="htmlbuttonelement" role="button" tabindex="0">HTMLButtonElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_97">HTMLElement</a> {
1.162 mike 369: 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>;
370: 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.551 ! mike 371: readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement_5">HTMLFormElement</a>? <a href="association-of-controls-and-forms.html#dom-fae-form" title="dom-fae-form">form</a>;
1.162 mike 372: 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>;
373: 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>;
374: 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>;
375: 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>;
376: 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>;
377: 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>;
378: 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>;
379: 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>;
380:
1.550 mike 381: readonly attribute boolean <a href="association-of-controls-and-forms.html#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
382: 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 href="association-of-controls-and-forms.html#dom-cva-validity" title="dom-cva-validity">validity</a>;
383: readonly attribute DOMString <a href="association-of-controls-and-forms.html#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
384: boolean <a href="association-of-controls-and-forms.html#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
385: void <a href="association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
1.9 mike 386:
1.551 ! mike 387: 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 href="forms.html#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
1.9 mike 388: };</pre>
389: </dd>
1.516 mike 390: </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
391: button. <p>The element is a <a href="forms.html#concept-button" id="concept-button_4" title="concept-button">button</a>.<p>The <dfn aria-haspopup="true" id="attr-button-type" role="button" tabindex="0"><code>type</code></dfn>
1.9 mike 392: attribute controls the behavior of the button when it is activated.
1.492 mike 393: It is an <a href="common-microsyntaxes.html#enumerated-attribute" id="enumerated-attribute_10">enumerated attribute</a>. The following table
1.160 mike 394: lists the keywords and states for the attribute — the keywords
1.9 mike 395: in the left column map to the states in the cell in the second
1.160 mike 396: column on the same row as the keyword.<table><thead><tr><th> Keyword
397: <th> State
398: <th> Brief description
1.461 mike 399: <tbody><tr><td><dfn aria-haspopup="true" id="attr-button-type-submit" role="button" tabindex="0"><code>submit</code></dfn>
1.162 mike 400: <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 401: <td>Submits the form.
1.461 mike 402: <tr><td><dfn aria-haspopup="true" id="attr-button-type-reset" role="button" tabindex="0"><code>reset</code></dfn>
1.162 mike 403: <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 404: <td>Resets the form.
1.461 mike 405: <tr><td><dfn aria-haspopup="true" id="attr-button-type-button" role="button" tabindex="0"><code>button</code></dfn>
1.162 mike 406: <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 407: <td>Does nothing.
1.162 mike 408: </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.526 mike 409: state.<p>If the <code title="attr-button-type"><a href="#attr-button-type" id="type_79">type</a></code> attribute is in
1.162 mike 410: 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.415 mike 411: 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.516 mike 412: explicitly associate the <code><a href="#the-button-element" id="button_12">button</a></code> element with its
1.527 mike 413: <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_37">name</a></code>
1.415 mike 414: 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_14">disabled</a></code> attribute is used to make
1.9 mike 415: the control non-interactive and to prevent its value from being
1.415 mike 416: submitted. The <code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus_2">autofocus</a></code>
417: 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
418: <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 419: be used to make submit buttons that do not trigger the constraint
1.415 mike 420: 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.526 mike 421: if the element's <code title="attr-button-type"><a href="#attr-button-type" id="type_80">type</a></code>
1.162 mike 422: 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.461 mike 423: state.<p>The <dfn aria-haspopup="true" id="attr-button-value" role="button" tabindex="0"><code>value</code></dfn>
1.9 mike 424: attribute gives the element's value for the purposes of form
1.162 mike 425: 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.415 mike 426: <code title="attr-button-value"><a href="#attr-button-value" id="value_31">value</a></code> attribute, if there is
1.160 mike 427: one, or the empty string otherwise.<p class="note">A button (and its value) is only included in the
1.9 mike 428: form submission if the button itself was used to initiate the form
1.160 mike 429: submission.<div class="example">
1.9 mike 430:
431: <p>The following button is labeled "Show hint" and pops up a dialog
432: box when activated:</p>
433:
434: <pre><button type=button
435: onclick="alert('This 15-20 minute piece was composed by George Gershwin.')">
436: Show hint
437: </button></pre>
438:
1.551 ! mike 439: </div><h4 id="the-select-element"><span class="secno">4.10.9 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>select</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
! 440: <dd><a href="content-models.html#flow-content" id="flow-content_126">Flow content</a>.</dd>
! 441: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_141">Phrasing content</a>.</dd>
! 442: <dd><a href="content-models.html#interactive-content" id="interactive-content_15">Interactive content</a>.</dd>
! 443: <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_9">form-associated element</a>.</dd>
! 444: <dt>Contexts in which this element can be used:</dt>
! 445: <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content_142">phrasing content</a> is expected.</dd>
! 446: <dt>Content model:</dt>
! 447: <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>
! 448: <dt>Content attributes:</dt>
! 449: <dd><a href="elements.html#global-attributes" id="global-attributes_90">Global attributes</a></dd>
! 450: <dd><code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus_3">autofocus</a></code></dd>
! 451: <dd><code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled_15">disabled</a></code></dd>
! 452: <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form_51">form</a></code></dd>
! 453: <dd><code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple_34">multiple</a></code></dd>
! 454: <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name_38">name</a></code></dd>
! 455: <dd><code title="attr-select-required"><a href="#attr-select-required" id="required_28">required</a></code></dd>
! 456: <dd><code title="attr-select-size"><a href="#attr-select-size" id="size_30">size</a></code></dd>
! 457: <dt>DOM interface:</dt>
! 458: <dd>
! 459: <pre class="idl">interface <dfn aria-haspopup="true" id="htmlselectelement" role="button" tabindex="0">HTMLSelectElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_98">HTMLElement</a> {
! 460: 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>;
! 461: 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>;
! 462: readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement_6">HTMLFormElement</a>? <a href="association-of-controls-and-forms.html#dom-fae-form" title="dom-fae-form">form</a>;
! 463: 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>;
! 464: 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>;
! 465: 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>;
! 466: 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>;
! 467:
! 468: readonly attribute DOMString <a href="#dom-select-type" title="dom-select-type">type</a>;
! 469:
! 470: readonly attribute <a href="urls.html#htmloptionscollection" id="htmloptionscollection_2">HTMLOptionsCollection</a> <a href="#dom-select-options" title="dom-select-options">options</a>;
! 471: attribute unsigned long <a href="#dom-select-length" title="dom-select-length">length</a>;
! 472: getter any <a href="#dom-select-item" title="dom-select-item">item</a>(in unsigned long index);
! 473: 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);
! 474: void <a href="#dom-select-add" title="dom-select-add">add</a>(in <a href="elements.html#htmlelement" id="htmlelement_99">HTMLElement</a> element, in optional <a href="elements.html#htmlelement" id="htmlelement_100">HTMLElement</a>? before);
! 475: void <a href="#dom-select-add" title="dom-select-add">add</a>(in <a href="elements.html#htmlelement" id="htmlelement_101">HTMLElement</a> element, in long before);
! 476: 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);
! 477:
! 478: readonly attribute <a href="urls.html#htmlcollection" id="htmlcollection_32">HTMLCollection</a> <a href="#dom-select-selectedoptions" title="dom-select-selectedOptions">selectedOptions</a>;
! 479: attribute long <a href="#dom-select-selectedindex" title="dom-select-selectedIndex">selectedIndex</a>;
! 480: attribute DOMString <a href="#dom-select-value" title="dom-select-value">value</a>;
! 481:
! 482: readonly attribute boolean <a href="association-of-controls-and-forms.html#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
! 483: 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 href="association-of-controls-and-forms.html#dom-cva-validity" title="dom-cva-validity">validity</a>;
! 484: readonly attribute DOMString <a href="association-of-controls-and-forms.html#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
! 485: boolean <a href="association-of-controls-and-forms.html#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
! 486: void <a href="association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
! 487:
! 488: 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 href="forms.html#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
! 489: };</pre>
! 490: </dd>
! 491: </dl><p>The <code><a href="#the-select-element" id="select_18">select</a></code> element represents a control for
! 492: selecting amongst a set of options.<p>The <dfn aria-haspopup="true" id="attr-select-multiple" role="button" tabindex="0"><code>multiple</code></dfn>
! 493: attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_14">boolean attribute</a>. If the attribute is
! 494: present, then the <code><a href="#the-select-element" id="select_19">select</a></code> element
! 495: <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
! 496: from the <a href="#concept-select-option-list" id="concept-select-option-list_1" title="concept-select-option-list">list of
! 497: options</a>. If the attribute is absent, then the
! 498: <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
! 499: 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 aria-haspopup="true" id="attr-select-size" role="button" tabindex="0"><code>size</code></dfn>
! 500: 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
! 501: 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>
! 502: greater than zero. If the <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple_35">multiple</a></code> attribute is present,
! 503: 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
! 504: default value is 4. If the <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple_36">multiple</a></code> attribute is absent,
! 505: 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
! 506: default value is 1.<p>The <dfn aria-haspopup="true" id="concept-select-option-list" role="button" tabindex="0">list of options</dfn>
! 507: for a <code><a href="#the-select-element" id="select_21">select</a></code> element consists of all the
! 508: <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>
! 509: element, and all the <code><a href="#the-option-element" id="option_11">option</a></code> element children of all the
! 510: <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>
! 511: element, in <a href="infrastructure.html#tree-order" id="tree-order_7">tree order</a>.<p>The <dfn aria-haspopup="true" id="attr-select-required" role="button" tabindex="0"><code>required</code></dfn>
! 512: attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_15">boolean attribute</a>. When specified, the
! 513: user will be required to select a value before submitting the
! 514: 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,
! 515: does not have a <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple_37">multiple</a></code>
! 516: 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;
! 517: and if the <a href="#concept-option-value" id="concept-option-value_0" title="concept-option-value">value</a> of the
! 518: first <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>
! 519: element's <a href="#concept-select-option-list" id="concept-select-option-list_3" title="concept-select-option-list">list of
! 520: options</a> (if any) is the empty string, and that
! 521: <code><a href="#the-option-element" id="option_13">option</a></code> element's parent node is the <code><a href="#the-select-element" id="select_26">select</a></code>
! 522: element (and not an <code><a href="#the-optgroup-element" id="optgroup_5">optgroup</a></code> element), then that
! 523: <code><a href="#the-option-element" id="option_14">option</a></code> is the <code><a href="#the-select-element" id="select_27">select</a></code> element's
! 524: <dfn aria-haspopup="true" id="placeholder-label-option" role="button" tabindex="0">placeholder label option</dfn>.<p>If a <code><a href="#the-select-element" id="select_28">select</a></code> element has a <code title="attr-select-required"><a href="#attr-select-required" id="required_30">required</a></code> attribute specified,
! 525: does not have a <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple_38">multiple</a></code>
! 526: 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,
! 527: then the <code><a href="#the-select-element" id="select_29">select</a></code> element must have a <a href="#placeholder-label-option" id="placeholder-label-option_0">placeholder
! 528: label option</a>.<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
! 529: explicitly associate the <code><a href="#the-select-element" id="select_30">select</a></code> element with its
! 530: <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_39">name</a></code>
! 531: 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_16">disabled</a></code> attribute is used to make
! 532: the control non-interactive and to prevent its value from being
! 533: submitted. The <code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus_4">autofocus</a></code>
! 534: attribute controls focus.<dl class="domintro"><dt><var title="">select</var> . <code id="dom-select-type" title="dom-select-type"><a href="#dom-select-type">type</a></code></dt>
! 535:
! 536: <dd>
! 537:
! 538: <p>Returns "<code title="">select-multiple</code>" if the element
! 539: has a <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple_39">multiple</a></code>
! 540: attribute, and "<code title="">select-one</code>"
! 541: otherwise.</p>
! 542:
! 543: </dd>
! 544:
! 545: <dt><var title="">select</var> . <code id="dom-select-options" title="dom-select-options"><a href="#dom-select-options">options</a></code></dt>
! 546:
! 547: <dd>
! 548:
! 549: <p>Returns an <code><a href="urls.html#htmloptionscollection" id="htmloptionscollection_3">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>
! 550:
! 551: </dd>
! 552:
! 553: <dt><var title="">select</var> . <code id="dom-select-length" title="dom-select-length"><a href="#dom-select-length">length</a></code> [ = <var title="">value</var> ]</dt>
! 554: <dd>
! 555: <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>
! 556: <p>When set to a smaller number, truncates the number of <code><a href="#the-option-element" id="option_15">option</a></code> elements in the <code><a href="#the-select-element" id="select_31">select</a></code>.</p>
! 557: <p>When set to a greater number, adds new blank <code><a href="#the-option-element" id="option_16">option</a></code> elements to the <code><a href="#the-select-element" id="select_32">select</a></code>.</p>
! 558: </dd>
! 559:
! 560: <dt><var title="">element</var> = <var title="">select</var> . <code id="dom-select-item" title="dom-select-item"><a href="#dom-select-item">item</a></code>(<var title="">index</var>)</dt>
! 561: <dt><var title="">select</var>[<var title="">index</var>]</dt>
! 562: <dd>
! 563: <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>
! 564: </dd>
! 565:
! 566: <dt><var title="">element</var> = <var title="">select</var> . <code id="dom-select-item" title="dom-select-item"><a href="#dom-select-item">namedItem</a></code>(<var title="">name</var>)</dt>
! 567: <dd>
! 568: <p>Returns the item with <a href="elements.html#concept-id" id="concept-id_12" title="concept-id">ID</a> or <code title="attr-option-name"><a href="obsolete.html#attr-option-name" id="name_58">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>
! 569: <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>
! 570: <p>Returns null if no element with that <a href="elements.html#concept-id" id="concept-id_13" title="concept-id">ID</a> could be found.</p>
! 571: </dd>
! 572:
! 573: <dt><var title="">select</var> . <code id="dom-select-add" title="dom-select-add"><a href="#dom-select-add">add</a></code>(<var title="">element</var> [, <var title="">before</var> ])</dt>
! 574: <dd>
! 575: <p>Inserts <var title="">element</var> before the node given by <var title="">before</var>.</p>
! 576: <p>The <var title="">before</var> argument can be a number, in
! 577: which case <var title="">element</var> is inserted before the item
! 578: 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
! 579: which case <var title="">element</var> is inserted before that
! 580: element.</p>
! 581: <p>If <var title="">before</var> is omitted, null, or a number out
! 582: of range, then <var title="">element</var> will be added at the
! 583: end of the list.</p>
! 584: <p>This method will throw a <code><a href="urls.html#hierarchy_request_err" id="hierarchy_request_err_5">HIERARCHY_REQUEST_ERR</a></code>
! 585: exception if <var title="">element</var> is an ancestor of the
! 586: element into which it is to be inserted. If <var title="">element</var> is not an <code><a href="#the-option-element" id="option_17">option</a></code> or
! 587: <code><a href="#the-optgroup-element" id="optgroup_6">optgroup</a></code> element, then the method does nothing.</p>
! 588: </dd>
! 589:
! 590: <dt><var title="">select</var> . <code id="dom-select-selectedoptions" title="dom-select-selectedOptions"><a href="#dom-select-selectedoptions">selectedOptions</a></code></dt>
! 591:
! 592: <dd>
! 593:
! 594: <p>Returns an <code><a href="urls.html#htmlcollection" id="htmlcollection_33">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
! 595: selected.</p>
! 596:
! 597: </dd>
! 598:
! 599: <dt><var title="">select</var> . <code id="dom-select-selectedindex" title="dom-select-selectedIndex"><a href="#dom-select-selectedindex">selectedIndex</a></code> [ = <var title="">value</var> ]</dt>
! 600:
! 601: <dd>
! 602:
! 603: <p>Returns the index of the first selected item, if any, or
! 604: −1 if there is no selected item.</p>
! 605:
! 606: <p>Can be set, to change the selection.</p>
! 607:
! 608: </dd>
! 609:
! 610: <dt><var title="">select</var> . <code id="dom-select-value" title="dom-select-value"><a href="#dom-select-value">value</a></code> [ = <var title="">value</var> ]</dt>
! 611:
! 612: <dd>
! 613:
! 614: <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
! 615: first selected item, if any, or the empty string if there is no
! 616: selected item.</p>
! 617:
! 618: <p>Can be set, to change the selection.</p>
! 619:
! 620: </dd>
! 621:
! 622: </dl><div class="example">
! 623:
! 624: <p>The following example shows how a <code><a href="#the-select-element" id="select_33">select</a></code> element
! 625: can be used to offer the user with a set of options from which the
! 626: user can select a single option. The default option is
! 627: preselected.</p>
! 628:
! 629: <pre><p>
! 630: <label for="unittype">Select unit type:</label>
! 631: <select id="unittype" name="unittype">
! 632: <option value="1"> Miner </option>
! 633: <option value="2"> Puffer </option>
! 634: <option value="3" selected> Snipey </option>
! 635: <option value="4"> Max </option>
! 636: <option value="5"> Firebot </option>
! 637: </select>
! 638: </p></pre>
! 639:
! 640: </div><div class="example">
! 641:
! 642: <p>Here, the user is offered a set of options from which he can
! 643: select any number. By default, all five options are selected.</p>
! 644:
! 645: <pre><p>
! 646: <label for="allowedunits">Select unit types to enable on this map:</label>
! 647: <select id="allowedunits" name="allowedunits" multiple>
! 648: <option value="1" selected> Miner </option>
! 649: <option value="2" selected> Puffer </option>
! 650: <option value="3" selected> Snipey </option>
! 651: <option value="4" selected> Max </option>
! 652: <option value="5" selected> Firebot </option>
! 653: </select>
! 654: </p></pre>
! 655:
! 656: </div><h4 id="the-datalist-element"><span class="secno">4.10.10 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>datalist</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
! 657: <dd><a href="content-models.html#flow-content" id="flow-content_127">Flow content</a>.</dd>
! 658: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_143">Phrasing content</a>.</dd>
! 659: <dt>Contexts in which this element can be used:</dt>
! 660: <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content_144">phrasing content</a> is expected.</dd>
! 661: <dt>Content model:</dt>
! 662: <dd>Either: <a href="content-models.html#phrasing-content" id="phrasing-content_145">phrasing content</a>.</dd>
! 663: <dd>Or: Zero or more <code><a href="#the-option-element" id="option_18">option</a></code> elements.</dd>
! 664: <dt>Content attributes:</dt>
! 665: <dd><a href="elements.html#global-attributes" id="global-attributes_91">Global attributes</a></dd>
! 666: <dt>DOM interface:</dt>
! 667: <dd>
! 668: <pre class="idl">interface <dfn aria-haspopup="true" id="htmldatalistelement" role="button" tabindex="0">HTMLDataListElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_102">HTMLElement</a> {
! 669: readonly attribute <a href="urls.html#htmlcollection" id="htmlcollection_34">HTMLCollection</a> <a href="#dom-datalist-options" title="dom-datalist-options">options</a>;
! 670: };</pre>
! 671: </dd>
! 672: </dl><p>The <code><a href="#the-datalist-element" id="datalist_13">datalist</a></code> element represents a set of
! 673: <code><a href="#the-option-element" id="option_19">option</a></code> elements that represent predefined options for
! 674: other controls. The contents of the element represents fallback
! 675: content for legacy user agents, intermixed with <code><a href="#the-option-element" id="option_20">option</a></code>
! 676: elements that represent the predefined options. In the rendering,
! 677: 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>
! 678: nothing.<p>The <code><a href="#the-datalist-element" id="datalist_15">datalist</a></code> element is hooked up to an
! 679: <code><a href="the-input-element.html#the-input-element" id="input_121">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
! 680: <code><a href="the-input-element.html#the-input-element" id="input_122">input</a></code> element.<p>Each <code><a href="#the-option-element" id="option_21">option</a></code> element that is a descendant of the
! 681: <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_0" 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
! 682: 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>.
! 683:
! 684: <dl class="domintro"><dt><var title="">datalist</var> . <code id="dom-datalist-options" title="dom-datalist-options"><a href="#dom-datalist-options">options</a></code></dt>
! 685:
! 686: <dd>
! 687: <p>Returns an <code><a href="urls.html#htmlcollection" id="htmlcollection_35">HTMLCollection</a></code> of the <code>options</code> elements of the table.</p>
! 688: </dd>
! 689:
! 690: </dl><h4 id="the-optgroup-element"><span class="secno">4.10.11 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>optgroup</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
! 691: <dd>None.</dd>
! 692: <dt>Contexts in which this element can be used:</dt>
! 693: <dd>As a child of a <code><a href="#the-select-element" id="select_34">select</a></code> element.</dd>
! 694: <dt>Content model:</dt>
! 695: <dd>Zero or more <code><a href="#the-option-element" id="option_22">option</a></code> elements.</dd>
! 696: <dt>Content attributes:</dt>
! 697: <dd><a href="elements.html#global-attributes" id="global-attributes_92">Global attributes</a></dd>
! 698: <dd><code title="attr-optgroup-disabled"><a href="#attr-optgroup-disabled" id="disabled_3">disabled</a></code></dd>
! 699: <dd><code title="attr-optgroup-label"><a href="#attr-optgroup-label" id="label_31">label</a></code></dd>
! 700: <dt>DOM interface:</dt>
! 701: <dd>
! 702: <pre class="idl">interface <dfn aria-haspopup="true" id="htmloptgroupelement" role="button" tabindex="0">HTMLOptGroupElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_103">HTMLElement</a> {
! 703: 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>;
! 704: 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>;
! 705: };</pre>
! 706: </dd>
! 707: </dl><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
! 708: <code><a href="#the-option-element" id="option_23">option</a></code> elements with a common label.<p>The element's group of <code><a href="#the-option-element" id="option_24">option</a></code> elements consists of
! 709: the <code><a href="#the-option-element" id="option_25">option</a></code> elements that are children of the
! 710: <code><a href="#the-optgroup-element" id="optgroup_8">optgroup</a></code> element.<p>The <dfn aria-haspopup="true" id="attr-optgroup-disabled" role="button" tabindex="0"><code>disabled</code></dfn> attribute
! 711: is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_16">boolean attribute</a> and can be used to <a href="#concept-option-disabled" id="concept-option-disabled_1" title="concept-option-disabled">disable</a> a group of
! 712: <code><a href="#the-option-element" id="option_26">option</a></code> elements together.<p>The <dfn aria-haspopup="true" id="attr-optgroup-label" role="button" tabindex="0"><code>label</code></dfn>
! 713: attribute must be specified. Its value gives the name of the group,
! 714: for the purposes of the user interface. <div class="example">
! 715:
! 716: <p>The following snippet shows how a set of lessons from three
! 717: courses could be offered in a <code><a href="#the-select-element" id="select_35">select</a></code> drop-down
! 718: widget:</p>
! 719:
! 720: <pre><form action="courseselector.dll" method="get">
! 721: <p>Which course would you like to watch today?
! 722: <p><label>Course:
! 723: <select name="c">
! 724: <optgroup label="8.01 Physics I: Classical Mechanics">
! 725: <option value="8.01.1">Lecture 01: Powers of Ten
! 726: <option value="8.01.2">Lecture 02: 1D Kinematics
! 727: <option value="8.01.3">Lecture 03: Vectors
! 728: <optgroup label="8.02 Electricity and Magnestism">
! 729: <option value="8.02.1">Lecture 01: What holds our world together?
! 730: <option value="8.02.2">Lecture 02: Electric Field
! 731: <option value="8.02.3">Lecture 03: Electric Flux
! 732: <optgroup label="8.03 Physics III: Vibrations and Waves">
! 733: <option value="8.03.1">Lecture 01: Periodic Phenomenon
! 734: <option value="8.03.2">Lecture 02: Beats
! 735: <option value="8.03.3">Lecture 03: Forced Oscillations with Damping
! 736: </select>
! 737: </label>
! 738: <p><input type=submit value="▶ Play">
! 739: </form></pre>
! 740:
! 741: </div><h4 id="the-option-element"><span class="secno">4.10.12 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>option</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
! 742: <dd>None.</dd>
! 743: <dt>Contexts in which this element can be used:</dt>
! 744: <dd>As a child of a <code><a href="#the-select-element" id="select_36">select</a></code> element.</dd>
! 745: <dd>As a child of a <code><a href="#the-datalist-element" id="datalist_17">datalist</a></code> element.</dd>
! 746: <dd>As a child of an <code><a href="#the-optgroup-element" id="optgroup_9">optgroup</a></code> element.</dd>
! 747: <dt>Content model:</dt>
! 748: <dd><a href="content-models.html#text-content" id="text-content_5" title="text content">Text</a>.</dd>
! 749: <dt>Content attributes:</dt>
! 750: <dd><a href="elements.html#global-attributes" id="global-attributes_93">Global attributes</a></dd>
! 751: <dd><code title="attr-option-disabled"><a href="#attr-option-disabled" id="disabled_6">disabled</a></code></dd>
! 752: <dd><code title="attr-option-label"><a href="#attr-option-label" id="label_33">label</a></code></dd>
! 753: <dd><code title="attr-option-selected"><a href="#attr-option-selected" id="selected_0">selected</a></code></dd>
! 754: <dd><code title="attr-option-value"><a href="#attr-option-value" id="value_34">value</a></code></dd>
! 755: <dt>DOM interface:</dt>
! 756: <dd>
! 757: <pre class="idl">[NamedConstructor=<a href="#dom-option" title="dom-option">Option</a>(),
! 758: 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),
! 759: 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),
! 760: 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),
! 761: 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)]
! 762: interface <dfn aria-haspopup="true" id="htmloptionelement" role="button" tabindex="0">HTMLOptionElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_104">HTMLElement</a> {
! 763: 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>;
! 764: readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement_7">HTMLFormElement</a>? <a href="#dom-option-form" title="dom-option-form">form</a>;
! 765: 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>;
! 766: 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>;
! 767: attribute boolean <a href="#dom-option-selected" title="dom-option-selected">selected</a>;
! 768: 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>;
! 769:
! 770: attribute DOMString <a href="#dom-option-text" title="dom-option-text">text</a>;
! 771: readonly attribute long <a href="#dom-option-index" title="dom-option-index">index</a>;
! 772: };</pre>
! 773: </dd>
! 774: </dl><p>The <code><a href="#the-option-element" id="option_27">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
! 775: in a <code><a href="#the-select-element" id="select_37">select</a></code> element or as part of a list of suggestions
! 776: 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
! 777: <code><a href="#the-select-element" id="select_38">select</a></code> element, an <code><a href="#the-option-element" id="option_28">option</a></code> element can be a
! 778: <code><a href="#the-select-element" id="select_39">select</a></code> element's <a href="#placeholder-label-option" id="placeholder-label-option_1">placeholder label option</a>.
! 779: A <a href="#placeholder-label-option" id="placeholder-label-option_2">placeholder label option</a> does not represent an actual
! 780: option, but instead represents a label for the <code><a href="#the-select-element" id="select_40">select</a></code>
! 781: control.<p>The <dfn aria-haspopup="true" id="attr-option-disabled" role="button" tabindex="0"><code>disabled</code></dfn>
! 782: attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_17">boolean attribute</a>. An
! 783: <code><a href="#the-option-element" id="option_29">option</a></code> element is <dfn aria-haspopup="true" id="concept-option-disabled" role="button" tabindex="0">disabled</dfn> if its <code title="attr-option-disabled"><a href="#attr-option-disabled" id="disabled_7">disabled</a></code> attribute is present or
! 784: 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
! 785: present.<p>The <dfn aria-haspopup="true" id="attr-option-label" role="button" tabindex="0"><code>label</code></dfn>
! 786: attribute provides a label for element. The <dfn aria-haspopup="true" id="concept-option-label" role="button" tabindex="0">label</dfn> of an <code><a href="#the-option-element" id="option_30">option</a></code>
! 787: 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,
! 788: 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 aria-haspopup="true" id="attr-option-value" role="button" tabindex="0"><code>value</code></dfn>
! 789: attribute provides a value for element. The <dfn aria-haspopup="true" id="concept-option-value" role="button" tabindex="0">value</dfn> of an <code><a href="#the-option-element" id="option_31">option</a></code>
! 790: 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,
! 791: 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 aria-haspopup="true" id="attr-option-selected" role="button" tabindex="0"><code>selected</code></dfn>
! 792: attribute is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_18">boolean attribute</a>. It represents the
! 793: 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
! 794: element.<p>A <code><a href="#the-select-element" id="select_41">select</a></code> element whose <code title="attr-select-multiple"><a href="#attr-select-multiple" id="multiple_40">multiple</a></code> attribute is not
! 795: specified must not have more than one descendant <code><a href="#the-option-element" id="option_32">option</a></code>
! 796: element with its <code title="attr-option-selected"><a href="#attr-option-selected" id="selected_1">selected</a></code>
! 797: attribute set.<dl class="domintro"><dt><var title="">option</var> . <code id="dom-option-selected" title="dom-option-selected"><a href="#dom-option-selected">selected</a></code></dt>
! 798:
! 799: <dd>
! 800:
! 801: <p>Returns true if the element is selected, and false otherwise.</p>
! 802:
! 803: <p>Can be set, to override the current state of the element.</p>
! 804:
! 805: </dd>
! 806:
! 807: <dt><var title="">option</var> . <code id="dom-option-index" title="dom-option-index"><a href="#dom-option-index">index</a></code></dt>
! 808:
! 809: <dd>
! 810:
! 811: <p>Returns the index of the element in its <code><a href="#the-select-element" id="select_42">select</a></code>
! 812: element's <code title="dom-select-options"><a href="#dom-select-options">options</a></code>
! 813: list.</p>
! 814:
! 815: </dd>
! 816:
! 817: <dt><var title="">option</var> . <code id="dom-option-form" title="dom-option-form"><a href="#dom-option-form">form</a></code></dt>
! 818:
! 819: <dd>
! 820:
! 821: <p>Returns the element's <code><a href="forms.html#the-form-element" id="form_22">form</a></code> element, if any, or
! 822: null otherwise.</p>
! 823:
! 824: </dd>
! 825:
! 826: <dt><var title="">option</var> . <code id="dom-option-text" title="dom-option-text"><a href="#dom-option-text">text</a></code></dt>
! 827:
! 828: <dd>
! 829:
! 830: <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>
! 831:
! 832: </dd>
! 833:
! 834: <dt><var title="">option</var> = new <code id="dom-option" title="dom-option"><a href="#dom-option">Option</a></code>( [ <var title="">text</var> [, <var title="">value</var> [, <var title="">defaultSelected</var> [, <var title="">selected</var> ] ] ] ] )</dt>
! 835:
! 836: <dd>
! 837:
! 838: <p>Returns a new <code><a href="#the-option-element" id="option_33">option</a></code> element.</p>
! 839:
! 840: <p>The <var title="">text</var> argument sets the contents of the element.</p>
! 841: <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>
! 842: <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>
! 843: <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>
! 844:
! 845: </dd>
! 846:
! 847: </dl><h4 id="the-textarea-element"><span class="secno">4.10.13 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>textarea</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
! 848: <dd><a href="content-models.html#flow-content" id="flow-content_128">Flow content</a>.</dd>
! 849: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_146">Phrasing content</a>.</dd>
! 850: <dd><a href="content-models.html#interactive-content" id="interactive-content_16">Interactive content</a>.</dd>
! 851: <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_10">form-associated element</a>.</dd>
! 852: <dt>Contexts in which this element can be used:</dt>
! 853: <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content_147">phrasing content</a> is expected.</dd>
! 854: <dt>Content model:</dt>
! 855: <dd><a href="content-models.html#text-content" id="text-content_6" title="text content">Text</a>.</dd>
! 856: <dt>Content attributes:</dt>
! 857: <dd><a href="elements.html#global-attributes" id="global-attributes_94">Global attributes</a></dd>
! 858: <dd><code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus_5">autofocus</a></code></dd>
! 859: <dd><code title="attr-textarea-cols"><a href="#attr-textarea-cols" id="cols">cols</a></code></dd>
! 860: <dd><code title="attr-textarea-dirname"><a href="#attr-textarea-dirname" id="dirname_26">dirname</a></code></dd>
! 861: <dd><code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled_17">disabled</a></code></dd>
! 862: <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form_53">form</a></code></dd>
! 863: <dd><code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength" id="maxlength_27">maxlength</a></code></dd>
! 864: <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name_40">name</a></code></dd>
! 865: <dd><code title="attr-textarea-placeholder"><a href="#attr-textarea-placeholder" id="placeholder_28">placeholder</a></code></dd>
! 866: <dd><code title="attr-textarea-readonly"><a href="#attr-textarea-readonly" id="readonly_41">readonly</a></code></dd>
! 867: <dd><code title="attr-textarea-required"><a href="#attr-textarea-required" id="required_33">required</a></code></dd>
! 868: <dd><code title="attr-textarea-rows"><a href="#attr-textarea-rows" id="rows">rows</a></code></dd>
! 869: <dd><code title="attr-textarea-wrap"><a href="#attr-textarea-wrap" id="wrap">wrap</a></code></dd>
! 870: <dt>DOM interface:</dt>
! 871: <dd>
! 872: <pre class="idl">interface <dfn aria-haspopup="true" id="htmltextareaelement" role="button" tabindex="0">HTMLTextAreaElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_105">HTMLElement</a> {
! 873: 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>;
! 874: 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>;
! 875: attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/the-button-element.html#dom-textarea-dirname" title='Read about this "dirName" reference in the full HTML5 spec.'>dirName</a>;
! 876: 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>;
! 877: readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement_8">HTMLFormElement</a>? <a href="association-of-controls-and-forms.html#dom-fae-form" title="dom-fae-form">form</a>;
! 878: 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>;
! 879: 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>;
! 880: 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>;
! 881: 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>;
! 882: 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>;
! 883: 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>;
! 884: 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>;
! 885:
! 886: 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>;
! 887: 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>;
! 888: 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>;
! 889: 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>;
! 890:
! 891: readonly attribute boolean <a href="association-of-controls-and-forms.html#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
! 892: 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 href="association-of-controls-and-forms.html#dom-cva-validity" title="dom-cva-validity">validity</a>;
! 893: readonly attribute DOMString <a href="association-of-controls-and-forms.html#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
! 894: boolean <a href="association-of-controls-and-forms.html#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
! 895: void <a href="association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
! 896:
! 897: 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 href="forms.html#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
! 898:
! 899: void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-textarea-input-select" title='Read about this "select" reference in the full HTML5 spec.'>select</a>();
! 900: attribute unsigned long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-textarea-input-selectionstart" title='Read about this "selectionStart" reference in the full HTML5 spec.'>selectionStart</a>;
! 901: attribute unsigned long <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-textarea-input-selectionend" title='Read about this "selectionEnd" reference in the full HTML5 spec.'>selectionEnd</a>;
! 902: attribute DOMString <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.html#dom-textarea-input-selectiondirection" title='Read about this "selectionDirection" reference in the full HTML5 spec.'>selectionDirection</a>;
! 903: void <a class="full-spec-link" href="http://dev.w3.org/html5/spec/association-of-controls-and-forms.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, in optional DOMString direction);
! 904: };</pre>
! 905: </dd>
! 906: </dl><p>The <code><a href="#the-textarea-element" id="textarea_24">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
! 907: multiline plain text edit control. The contents of the control represent the
! 908: control's default value.<p>The <dfn aria-haspopup="true" id="attr-textarea-readonly" role="button" tabindex="0"><code>readonly</code></dfn> attribute
! 909: is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_19">boolean attribute</a> used to control whether the text
! 910: can be edited by the user or not.<p>The <dfn aria-haspopup="true" id="attr-textarea-cols" role="button" tabindex="0"><code>cols</code></dfn>
! 911: attribute specifies the expected maximum number of characters per
! 912: line. If the <code title="attr-textarea-cols"><a href="#attr-textarea-cols" id="cols_0">cols</a></code> attribute
! 913: 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
! 914: integer</a> greater than zero. <p>The <dfn aria-haspopup="true" id="attr-textarea-rows" role="button" tabindex="0"><code>rows</code></dfn>
! 915: 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
! 916: 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
! 917: zero. <p>The <dfn aria-haspopup="true" id="attr-textarea-wrap" role="button" tabindex="0"><code>wrap</code></dfn>
! 918: attribute is an <a href="common-microsyntaxes.html#enumerated-attribute" id="enumerated-attribute_11">enumerated attribute</a> with two keywords
! 919: and states: the <dfn aria-haspopup="true" id="attr-textarea-wrap-soft" role="button" tabindex="0"><code>soft</code></dfn> keyword
! 920: 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
! 921: <dfn aria-haspopup="true" id="attr-textarea-wrap-hard" role="button" tabindex="0"><code>hard</code></dfn> keyword
! 922: 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
! 923: <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 aria-haspopup="true" id="attr-textarea-wrap-soft-state" role="button" tabindex="0">Soft</dfn> state
! 924: indicates that the text in the <code><a href="#the-textarea-element" id="textarea_25">textarea</a></code> is not to be
! 925: wrapped when it is submitted (though it can still be wrapped in the
! 926: rendering).<p>The <dfn aria-haspopup="true" id="attr-textarea-wrap-hard-state" role="button" tabindex="0">Hard</dfn> state
! 927: indicates that the text in the <code><a href="#the-textarea-element" id="textarea_26">textarea</a></code> is to have
! 928: newlines added by the user agent so that the text is wrapped when it
! 929: is submitted.<p>If the element's <code title="attr-textarea-wrap"><a href="#attr-textarea-wrap" id="wrap_0">wrap</a></code>
! 930: 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
! 931: specified.<p>The <dfn aria-haspopup="true" id="attr-textarea-maxlength" role="button" tabindex="0"><code>maxlength</code></dfn>
! 932: 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
! 933: <code><a href="#the-textarea-element" id="textarea_27">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_28">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
! 934: value length</a>, then the element's children must be such that
! 935: 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
! 936: <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
! 937: 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 aria-haspopup="true" id="attr-textarea-required" role="button" tabindex="0"><code>required</code></dfn> attribute
! 938: is a <a href="common-microsyntaxes.html#boolean-attribute" id="boolean-attribute_20">boolean attribute</a>. When specified, the user will
! 939: be required to enter a value before submitting the form.<p>The <dfn aria-haspopup="true" id="attr-textarea-placeholder" role="button" tabindex="0"><code>placeholder</code></dfn>
! 940: attribute represents a hint (a word or short phrase) intended to aid
! 941: the user with data entry. A hint could be a sample value or a brief
! 942: description of the expected format. The attribute, if specified,
! 943: must have a value that contains no U+000A LINE FEED (LF) or U+000D
! 944: 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>
! 945: attribute should not be used as an alternative to a
! 946: <code><a href="forms.html#the-label-element" id="label_20">label</a></code>.<p>The <dfn aria-haspopup="true" id="attr-textarea-dirname" role="button" tabindex="0"><code>dirname</code></dfn>
! 947: 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>
! 948: 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
! 949: explicitly associate the <code><a href="#the-textarea-element" id="textarea_29">textarea</a></code> element with its
! 950: <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_41">name</a></code>
! 951: 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_18">disabled</a></code> attribute is used to make
! 952: the control non-interactive and to prevent its value from being
! 953: submitted. The <code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus_6">autofocus</a></code>
! 954: attribute controls focus.<dl class="domintro"><dt><var title="">textarea</var> . <code title="attr-textarea-type">type</code></dt>
! 955:
! 956: <dd>
! 957:
! 958: <p>Returns the string "<code title="">textarea</code>".</p>
! 959:
! 960: </dd>
! 961:
! 962: <dt><var title="">textarea</var> . <code title="attr-textarea-value">value</code></dt>
! 963:
! 964: <dd>
! 965:
! 966: <p>Returns the current value of the element.</p>
! 967:
! 968: <p>Can be set, to change the value.</p>
! 969:
! 970: </dd>
! 971:
! 972: </dl><div class="example">
! 973:
! 974: <p>Here is an example of a <code><a href="#the-textarea-element" id="textarea_30">textarea</a></code> being used for
! 975: unrestricted free-form text input in a form:</p>
! 976:
! 977: <pre><p>If you have any comments, please let us know: <textarea cols=80 name=comments></textarea></p></pre>
! 978:
! 979: <p>To specify a maximum length for the comments, one can use
! 980: the <code title="attr-textarea-maxlength"><a href="#attr-textarea-maxlength" id="maxlength_28">maxlength</a></code>
! 981: attribute:</p>
! 982:
! 983: <pre><p>If you have any short comments, please let us know: <textarea cols=80 name=comments maxlength=200></textarea></p></pre>
! 984:
! 985: <p>To give a default value, text can be included inside the element:</p>
! 986:
! 987: <pre><p>If you have any comments, please let us know: <textarea cols=80 name=comments>You rock!</textarea></p></pre>
! 988:
! 989: <p>To have the browser submit <a href="elements.html#the-directionality" id="the-directionality_9">the directionality</a> of
! 990: 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
! 991: specified:</p>
! 992:
! 993: <pre><p>If you have any comments, please let us know (you may use either English or Hebrew for your comments):
! 994: <textarea cols=80 name=comments dirname=comments.dir></textarea></p></pre>
! 995:
! 996: </div><h4 id="the-keygen-element"><span class="secno">4.10.14 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>keygen</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
! 997: <dd><a href="content-models.html#flow-content" id="flow-content_129">Flow content</a>.</dd>
! 998: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_148">Phrasing content</a>.</dd>
! 999: <dd><a href="content-models.html#interactive-content" id="interactive-content_17">Interactive content</a>.</dd>
! 1000: <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_11">form-associated element</a>.</dd>
! 1001: <dt>Contexts in which this element can be used:</dt>
! 1002: <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content_149">phrasing content</a> is expected.</dd>
! 1003: <dt>Content model:</dt>
! 1004: <dd>Empty.</dd>
! 1005: <dt>Content attributes:</dt>
! 1006: <dd><a href="elements.html#global-attributes" id="global-attributes_95">Global attributes</a></dd>
! 1007: <dd><code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus_7">autofocus</a></code></dd>
! 1008: <dd><code title="attr-keygen-challenge"><a href="#attr-keygen-challenge" id="challenge">challenge</a></code></dd>
! 1009: <dd><code title="attr-fe-disabled"><a href="association-of-controls-and-forms.html#attr-fe-disabled" id="disabled_19">disabled</a></code></dd>
! 1010: <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form_55">form</a></code></dd>
! 1011: <dd><code title="attr-keygen-keytype"><a href="#attr-keygen-keytype" id="keytype">keytype</a></code></dd>
! 1012: <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name_42">name</a></code></dd>
! 1013: <dt>DOM interface:</dt>
! 1014: <dd>
! 1015: <pre class="idl">interface <dfn aria-haspopup="true" id="htmlkeygenelement" role="button" tabindex="0">HTMLKeygenElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_106">HTMLElement</a> {
! 1016: 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>;
! 1017: 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>;
! 1018: 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>;
! 1019: readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement_9">HTMLFormElement</a>? <a href="association-of-controls-and-forms.html#dom-fae-form" title="dom-fae-form">form</a>;
! 1020: 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>;
! 1021: 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>;
! 1022:
! 1023: 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>;
! 1024:
! 1025: readonly attribute boolean <a href="association-of-controls-and-forms.html#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
! 1026: 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 href="association-of-controls-and-forms.html#dom-cva-validity" title="dom-cva-validity">validity</a>;
! 1027: readonly attribute DOMString <a href="association-of-controls-and-forms.html#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
! 1028: boolean <a href="association-of-controls-and-forms.html#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
! 1029: void <a href="association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
! 1030:
! 1031: 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 href="forms.html#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
! 1032: };</pre>
! 1033: </dd>
! 1034: </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
! 1035: pair generator control. When the control's form is submitted, the
! 1036: private key is stored in the local keystore, and the public key is
! 1037: packaged and sent to the server.<p>The <dfn aria-haspopup="true" id="attr-keygen-challenge" role="button" tabindex="0"><code>challenge</code></dfn> attribute
! 1038: may be specified. Its value will be packaged with the submitted
! 1039: key.<p>The <dfn aria-haspopup="true" id="attr-keygen-keytype" role="button" tabindex="0"><code>keytype</code></dfn>
! 1040: attribute is an <a href="common-microsyntaxes.html#enumerated-attribute" id="enumerated-attribute_12">enumerated attribute</a>. The following
! 1041: table lists the keywords and states for the attribute — the
! 1042: keywords in the left column map to the states listed in the cell in
! 1043: the second column on the same row as the keyword. User agents are
! 1044: not required to support these values, and must only recognize values
! 1045: whose corresponding algorithms they support.<table><thead><tr><th> Keyword <th> State
! 1046: <tbody><tr><td> <code title="">rsa</code>
! 1047: <td> <i title="">RSA</i>
! 1048: </table><p>The <i>invalid value default</i> state is the <i title="">unknown</i> state. The <i>missing value default</i> state
! 1049: 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
! 1050: user agents are to support — it is possible for a user agent
! 1051: 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
! 1052: explicitly associate the <code><a href="#the-keygen-element" id="keygen_13">keygen</a></code> element with its
! 1053: <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_43">name</a></code>
! 1054: 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_20">disabled</a></code> attribute is used to make
! 1055: the control non-interactive and to prevent its value from being
! 1056: submitted. The <code title="attr-fe-autofocus"><a href="association-of-controls-and-forms.html#attr-fe-autofocus" id="autofocus_8">autofocus</a></code>
! 1057: attribute controls focus.<dl class="domintro"><dt><var title="">keygen</var> . <code title="attr-keygen-type">type</code></dt>
! 1058:
! 1059: <dd>
! 1060:
! 1061: <p>Returns the string "<code title="">keygen</code>".</p>
! 1062:
! 1063: </dd>
! 1064:
! 1065: </dl><p class="note">This specification does not specify how the private
! 1066: key generated is to be used. It is expected that after receiving the
! 1067: <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
! 1068: server will generate a client certificate and offer it back to the
! 1069: user for download; this certificate, once downloaded and stored in
! 1070: the key store along with the private key, can then be used to
! 1071: authenticate to services that use TLS and certificate
! 1072: authentication.<div class="example">
! 1073:
! 1074: <p>To generate a key pair, add the private key to the user's key
! 1075: store, and submit the public key to the server, markup such as the
! 1076: following can be used:</p>
! 1077:
! 1078: <pre><form action="processkey.cgi" method="post" enctype="multipart/form-data">
! 1079: <p><keygen name="key"></p>
! 1080: <p><input type=submit value="Submit key..."></p>
! 1081: </form></pre>
! 1082:
! 1083: <p>The server will then receive a form submission with a packaged
! 1084: RSA public key as the value of "<code title="">key</code>". This
! 1085: can then be used for various purposes, such as generating a client
! 1086: certificate, as mentioned above.</p>
! 1087:
! 1088: </div><h4 id="the-output-element"><span class="secno">4.10.15 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>output</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
! 1089: <dd><a href="content-models.html#flow-content" id="flow-content_130">Flow content</a>.</dd>
! 1090: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_150">Phrasing content</a>.</dd>
! 1091: <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_12">form-associated element</a>.</dd>
! 1092: <dt>Contexts in which this element can be used:</dt>
! 1093: <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content_151">phrasing content</a> is expected.</dd>
! 1094: <dt>Content model:</dt>
! 1095: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_152">Phrasing content</a>.</dd>
! 1096: <dt>Content attributes:</dt>
! 1097: <dd><a href="elements.html#global-attributes" id="global-attributes_96">Global attributes</a></dd>
! 1098: <dd><code title="attr-output-for"><a href="#attr-output-for" id="for_2">for</a></code></dd>
! 1099: <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form_57">form</a></code></dd>
! 1100: <dd><code title="attr-fe-name"><a href="association-of-controls-and-forms.html#attr-fe-name" id="name_44">name</a></code></dd>
! 1101: <dt>DOM interface:</dt>
! 1102: <dd>
! 1103: <pre class="idl">interface <dfn aria-haspopup="true" id="htmloutputelement" role="button" tabindex="0">HTMLOutputElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_107">HTMLElement</a> {
! 1104: [PutForwards=<a href="urls.html#dom-domsettabletokenlist-value" title="dom-DOMSettableTokenList-value">value</a>] readonly attribute <a href="urls.html#domsettabletokenlist" id="domsettabletokenlist_5">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>;
! 1105: readonly attribute <a href="forms.html#htmlformelement" id="htmlformelement_10">HTMLFormElement</a>? <a href="association-of-controls-and-forms.html#dom-fae-form" title="dom-fae-form">form</a>;
! 1106: 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>;
! 1107:
! 1108: readonly attribute DOMString <a href="#dom-output-type" title="dom-output-type">type</a>;
! 1109: attribute DOMString <a href="#dom-output-defaultvalue" title="dom-output-defaultValue">defaultValue</a>;
! 1110: attribute DOMString <a href="#dom-output-value" title="dom-output-value">value</a>;
! 1111:
! 1112: readonly attribute boolean <a href="association-of-controls-and-forms.html#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
! 1113: 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 href="association-of-controls-and-forms.html#dom-cva-validity" title="dom-cva-validity">validity</a>;
! 1114: readonly attribute DOMString <a href="association-of-controls-and-forms.html#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
! 1115: boolean <a href="association-of-controls-and-forms.html#dom-cva-checkvalidatity" title="dom-cva-checkValidatity">checkValidity</a>();
! 1116: void <a href="association-of-controls-and-forms.html#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(in DOMString error);
! 1117:
! 1118: 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 href="forms.html#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
! 1119: };</pre>
! 1120: </dd>
! 1121: </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
! 1122: calculation.<p>The <dfn aria-haspopup="true" id="attr-output-for" role="button" tabindex="0"><code>for</code></dfn> content
! 1123: attribute allows an explicit relationship to be made between the
! 1124: result of a calculation and the elements that represent the values
! 1125: that went into the calculation or that otherwise influenced the
! 1126: calculation. The <code title="attr-output-for"><a href="#attr-output-for" id="for_3">for</a></code> attribute,
! 1127: 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_2">unordered
! 1128: set of unique space-separated tokens</a> that are
! 1129: <a href="infrastructure.html#case-sensitive" id="case-sensitive_5">case-sensitive</a>, each of which must have the value of an
! 1130: <a href="elements.html#concept-id" id="concept-id_14" title="concept-id">ID</a> of an element in the same
! 1131: <code><a href="infrastructure.html#document" id="document_66">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
! 1132: explicitly associate the <code><a href="#the-output-element" id="output_12">output</a></code> element with its
! 1133: <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_45">name</a></code>
! 1134: attribute represents the element's name.<dl class="domintro"><dt><var title="">output</var> . <code id="dom-output-value" title="dom-output-value"><a href="#dom-output-value">value</a></code> [ = <var title="">value</var> ]</dt>
! 1135:
! 1136: <dd>
! 1137:
! 1138: <p>Returns the element's current value.</p>
! 1139:
! 1140: <p>Can be set, to change the value.</p>
! 1141:
! 1142: </dd>
! 1143:
! 1144: <dt><var title="">output</var> . <code id="dom-output-defaultvalue" title="dom-output-defaultValue"><a href="#dom-output-defaultvalue">defaultValue</a></code> [ = <var title="">value</var> ]</dt>
! 1145:
! 1146: <dd>
! 1147:
! 1148: <p>Returns the element's current default value.</p>
! 1149:
! 1150: <p>Can be set, to change the default value.</p>
! 1151:
! 1152: </dd>
! 1153:
! 1154: <dt><var title="">output</var> . <code id="dom-output-type" title="dom-output-type"><a href="#dom-output-type">type</a></code></dt>
! 1155:
! 1156: <dd>
! 1157:
! 1158: <p>Returns the string "<code title="">output</code>".</p>
! 1159:
! 1160: </dd>
! 1161:
! 1162: </dl><div class="example">
! 1163:
! 1164: <p>A simple calculator could use <code><a href="#the-output-element" id="output_13">output</a></code> for its
! 1165: display of calculated results:</p>
! 1166:
! 1167: <pre><form onsubmit="return false" oninput="o.value = a.valueAsNumber + b.valueAsNumber">
! 1168: <input name=a type=number step=any> +
! 1169: <input name=b type=number step=any> =
! 1170: <output name=o></output>
! 1171: </form></pre>
! 1172:
! 1173: </div><h4 id="the-progress-element"><span class="secno">4.10.16 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>progress</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
! 1174: <dd><a href="content-models.html#flow-content" id="flow-content_131">Flow content</a>.</dd>
! 1175: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_153">Phrasing content</a>.</dd>
! 1176: <dd><a href="forms.html#category-label" id="category-label_8" title="category-label">Labelable element</a>.</dd>
! 1177: <dt>Contexts in which this element can be used:</dt>
! 1178: <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content_154">phrasing content</a> is expected.</dd>
! 1179: <dt>Content model:</dt>
! 1180: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_155">Phrasing content</a>, but there must be no <code><a href="#the-progress-element" id="progress_6">progress</a></code> element descendants.</dd>
! 1181: <dt>Content attributes:</dt>
! 1182: <dd><a href="elements.html#global-attributes" id="global-attributes_97">Global attributes</a></dd>
! 1183: <dd><code title="attr-progress-value"><a href="#attr-progress-value" id="value_38">value</a></code></dd>
! 1184: <dd><code title="attr-progress-max"><a href="#attr-progress-max" id="max_36">max</a></code></dd>
! 1185: <dt>DOM interface:</dt>
! 1186: <dd>
! 1187: <pre class="idl">interface <dfn aria-haspopup="true" id="htmlprogresselement" role="button" tabindex="0">HTMLProgressElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_108">HTMLElement</a> {
! 1188: 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>;
! 1189: 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>;
! 1190: readonly attribute double <a href="#dom-progress-position" title="dom-progress-position">position</a>;
! 1191: 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 href="forms.html#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
! 1192: };</pre>
! 1193: </dd>
! 1194: </dl><p>The <code><a href="#the-progress-element" id="progress_7">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
! 1195: completion progress of a task. The progress is either indeterminate,
! 1196: indicating that progress is being made but that it is not clear how
! 1197: much more work remains to be done before the task is complete (e.g.
! 1198: because the task is waiting for a remote host to respond), or the
! 1199: progress is a number in the range zero to a maximum, giving the
! 1200: fraction of work that has so far been completed.<p>There are two attributes that determine the current task
! 1201: completion represented by the element. The <dfn aria-haspopup="true" id="attr-progress-value" role="button" tabindex="0"><code>value</code></dfn> attribute
! 1202: specifies how much of the task has been completed, and the <dfn aria-haspopup="true" id="attr-progress-max" role="button" tabindex="0"><code>max</code></dfn> attribute specifies
! 1203: how much work the task requires in total. The units are arbitrary
! 1204: and not specified.<p class="note">To make an determinate progress bar, add a <code title="attr-progress-value"><a href="#attr-progress-value" id="value_39">value</a></code> attribute with the current
! 1205: progress (either a number from 0.0 to 1.0, or, if the <code title="attr-progress-max"><a href="#attr-progress-max" id="max_37">max</a></code> attribute is specified, a
! 1206: number from 0 to the value of the <code title="attr-progress-max"><a href="#attr-progress-max" id="max_38">max</a></code> attribute. To make an
! 1207: indeterminate progress bar, remove the <code title="attr-progress-value"><a href="#attr-progress-value" id="value_40">value</a></code> attribute.<p>Authors are encouraged to also include the current value and the
! 1208: maximum value inline as text inside the element, so that the
! 1209: progress is made available to users of legacy user agents.<div class="example">
! 1210: <p>Here is a snippet of a Web application that shows the progress
! 1211: of some automated task:</p>
! 1212: <pre><section>
! 1213: <h2>Task Progress</h2>
! 1214: <p>Progress: <progress id="p" max=100><span>0</span>%</progress></p>
! 1215: <script>
! 1216: var progressBar = document.getElementById('p');
! 1217: function updateProgress(newValue) {
! 1218: progressBar.value = newValue;
! 1219: progressBar.getElementsByTagName('span')[0].textContent = newValue;
! 1220: }
! 1221: </script>
! 1222: </section></pre>
! 1223: <p>(The <code>updateProgress()</code> method in this example would
! 1224: be called by some other code on the page to update the actual
! 1225: progress bar as the task progressed.)</p>
! 1226: </div><p>The <code title="attr-progress-value"><a href="#attr-progress-value" id="value_41">value</a></code> and <code title="attr-progress-max"><a href="#attr-progress-max" id="max_39">max</a></code> attributes, when present, must
! 1227: 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
! 1228: floating point numbers</a>. The <code title="attr-progress-value"><a href="#attr-progress-value" id="value_42">value</a></code> attribute, if present, must
! 1229: have a value equal to or greater than zero, and less than or equal
! 1230: to the value of the <code title="attr-progress-max"><a href="#attr-progress-max" id="max_40">max</a></code>
! 1231: attribute, if present, or 1.0, otherwise. The <code title="attr-progress-max"><a href="#attr-progress-max" id="max_41">max</a></code> attribute, if present, must
! 1232: have a value greater than zero.<p class="note">The <code><a href="#the-progress-element" id="progress_8">progress</a></code> element is the wrong
! 1233: element to use for something that is just a gauge, as opposed to
! 1234: task progress. For instance, indicating disk space usage using
! 1235: <code><a href="#the-progress-element" id="progress_9">progress</a></code> would be inappropriate. Instead, the
! 1236: <code><a href="#the-meter-element" id="meter_6">meter</a></code> element is available for such use cases.<dl class="domintro"><dt><var title="">progress</var> . <code id="dom-progress-position" title="dom-progress-position"><a href="#dom-progress-position">position</a></code></dt>
! 1237:
! 1238: <dd>
! 1239:
! 1240: <p>For a determinate progress bar (one with known current and
! 1241: maximum values), returns the result of dividing the current value
! 1242: by the maximum value.</p>
! 1243:
! 1244: <p>For an indeterminate progress bar, returns −1.</p>
! 1245:
! 1246: </dd>
! 1247:
! 1248: </dl><h4 id="the-meter-element"><span class="secno">4.10.17 </span>The <dfn aria-haspopup="true" role="button" tabindex="0"><code>meter</code></dfn> element</h4><dl class="element"><dt>Categories</dt>
! 1249: <dd><a href="content-models.html#flow-content" id="flow-content_132">Flow content</a>.</dd>
! 1250: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_156">Phrasing content</a>.</dd>
! 1251: <dd><a href="forms.html#category-label" id="category-label_9" title="category-label">Labelable element</a>.</dd>
! 1252: <dt>Contexts in which this element can be used:</dt>
! 1253: <dd>Where <a href="content-models.html#phrasing-content" id="phrasing-content_157">phrasing content</a> is expected.</dd>
! 1254: <dt>Content model:</dt>
! 1255: <dd><a href="content-models.html#phrasing-content" id="phrasing-content_158">Phrasing content</a>, but there must be no <code><a href="#the-meter-element" id="meter_7">meter</a></code> element descendants.</dd>
! 1256: <dt>Content attributes:</dt>
! 1257: <dd><a href="elements.html#global-attributes" id="global-attributes_98">Global attributes</a></dd>
! 1258: <dd><code title="attr-meter-value"><a href="#attr-meter-value" id="value_44">value</a></code></dd>
! 1259: <dd><code title="attr-meter-min"><a href="#attr-meter-min" id="min_38">min</a></code></dd>
! 1260: <dd><code title="attr-meter-max"><a href="#attr-meter-max" id="max_43">max</a></code></dd>
! 1261: <dd><code title="attr-meter-low"><a href="#attr-meter-low" id="low">low</a></code></dd>
! 1262: <dd><code title="attr-meter-high"><a href="#attr-meter-high" id="high">high</a></code></dd>
! 1263: <dd><code title="attr-meter-optimum"><a href="#attr-meter-optimum" id="optimum">optimum</a></code></dd>
! 1264: <dt>DOM interface:</dt>
! 1265: <dd>
! 1266: <pre class="idl">interface <dfn aria-haspopup="true" id="htmlmeterelement" role="button" tabindex="0">HTMLMeterElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_109">HTMLElement</a> {
! 1267: 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>;
! 1268: 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>;
! 1269: 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>;
! 1270: 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>;
! 1271: 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>;
! 1272: 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>;
! 1273: 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 href="forms.html#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
! 1274: };</pre>
! 1275: </dd>
! 1276: </dl><p>The <code><a href="#the-meter-element" id="meter_8">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
! 1277: measurement within a known range, or a fractional value; for example
! 1278: disk usage, the relevance of a query result, or the fraction of a
! 1279: 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_9">meter</a></code> element should not be used to
! 1280: indicate progress (as in a progress bar). For that role, HTML
! 1281: provides a separate <code><a href="#the-progress-element" id="progress_10">progress</a></code> element.<p class="note">The <code><a href="#the-meter-element" id="meter_10">meter</a></code> element also does not
! 1282: represent a scalar value of arbitrary range — for example, it
! 1283: would be wrong to use this to report a weight, or height, unless
! 1284: there is a known maximum value.<p>There are six attributes that determine the semantics of the
! 1285: gauge represented by the element.<p>The <dfn aria-haspopup="true" id="attr-meter-min" role="button" tabindex="0"><code>min</code></dfn> attribute
! 1286: specifies the lower bound of the range, and the <dfn aria-haspopup="true" id="attr-meter-max" role="button" tabindex="0"><code>max</code></dfn> attribute specifies
! 1287: the upper bound. The <dfn aria-haspopup="true" id="attr-meter-value" role="button" tabindex="0"><code>value</code></dfn> attribute
! 1288: specifies the value to have the gauge indicate as the "measured"
! 1289: value.<p>The other three attributes can be used to segment the gauge's
! 1290: range into "low", "medium", and "high" parts, and to indicate which
! 1291: part of the gauge is the "optimum" part. The <dfn aria-haspopup="true" id="attr-meter-low" role="button" tabindex="0"><code>low</code></dfn> attribute specifies
! 1292: the range that is considered to be the "low" part, and the <dfn aria-haspopup="true" id="attr-meter-high" role="button" tabindex="0"><code>high</code></dfn> attribute specifies
! 1293: the range that is considered to be the "high" part. The <dfn aria-haspopup="true" id="attr-meter-optimum" role="button" tabindex="0"><code>optimum</code></dfn> attribute
! 1294: gives the position that is "optimum"; if that is higher than the
! 1295: "high" value then this indicates that the higher the value, the
! 1296: better; if it's lower than the "low" mark then it indicates that
! 1297: lower values are better, and naturally if it is in between then it
! 1298: indicates that neither high nor low values are good.<p> The <code title="attr-meter-value"><a href="#attr-meter-value" id="value_45">value</a></code> attribute must be
! 1299: specified. The <code title="attr-meter-value"><a href="#attr-meter-value" id="value_46">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_44">max</a></code>, and <code title="attr-meter-optimum"><a href="#attr-meter-optimum" id="optimum_0">optimum</a></code> attributes, when present,
! 1300: must have values that are <a href="common-microsyntaxes.html#valid-floating-point-number" id="valid-floating-point-number_10" title="valid floating point
! 1301: 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_47">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
! 1302: attribute is specified, then let <var title="">minimum</var> be that
! 1303: attribute's value; otherwise, let it be zero.<p>If the <code title="attr-meter-max"><a href="#attr-meter-max" id="max_45">max</a></code> attribute
! 1304: attribute is specified, then let <var title="">maximum</var> be that
! 1305: 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> ≤ <var title="">value</var> ≤ <var title="">maximum</var></li>
! 1306: <li><var title="">minimum</var> ≤ <code title="attr-meter-low"><a href="#attr-meter-low" id="low_1">low</a></code> ≤ <var title="">maximum</var> (if <code title="attr-meter-low"><a href="#attr-meter-low" id="low_2">low</a></code> is specified)</li>
! 1307: <li><var title="">minimum</var> ≤ <code title="attr-meter-high"><a href="#attr-meter-high" id="high_1">high</a></code> ≤ <var title="">maximum</var> (if <code title="attr-meter-high"><a href="#attr-meter-high" id="high_2">high</a></code> is specified)</li>
! 1308: <li><var title="">minimum</var> ≤ <code title="attr-meter-optimum"><a href="#attr-meter-optimum" id="optimum_1">optimum</a></code> ≤ <var title="">maximum</var> (if <code title="attr-meter-optimum"><a href="#attr-meter-optimum" id="optimum_2">optimum</a></code> is specified)</li>
! 1309: <li><code title="attr-meter-low"><a href="#attr-meter-low" id="low_3">low</a></code> ≤ <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>
! 1310: </ul><p class="note">If no minimum or maximum is specified, then the
! 1311: range is assumed to be 0..1, and the value thus has to be within
! 1312: that range.<p>Authors are encouraged to include a textual representation of the
! 1313: gauge's state in the element's contents, for users of user agents
! 1314: that do not support the <code><a href="#the-meter-element" id="meter_11">meter</a></code> element.<div class="example">
! 1315:
! 1316: <p>The following examples show three gauges that would all be
! 1317: three-quarters full:</p>
! 1318:
! 1319: <pre>Storage space usage: <meter value=6 max=8>6 blocks used (out of 8 total)</meter>
! 1320: Voter turnout: <meter value=0.75><img alt="75%" src="graph75.png"></meter>
! 1321: Tickets sold: <meter min="0" max="100" value="75"></meter></pre>
! 1322:
! 1323: <p>The following example is incorrect use of the element, because
! 1324: it doesn't give a range (and since the default maximum is 1, both
! 1325: of the gauges would end up looking maxed out):</p>
! 1326:
! 1327: <pre class="bad"><p>The grapefruit pie had a radius of <meter value=12>12cm</meter>
! 1328: and a height of <meter value=2>2cm</meter>.</p> <!-- <strong>BAD!</strong> --></pre>
! 1329:
! 1330: <p>Instead, one would either not include the meter element, or use
! 1331: the meter element with a defined range to give the dimensions in
! 1332: context compared to other pies:</p>
! 1333:
! 1334: <pre><p>The grapefruit pie had a radius of 12cm and a height of
! 1335: 2cm.</p>
! 1336: <dl>
! 1337: <dt>Radius: <dd> <meter min=0 max=20 value=12>12cm</meter>
! 1338: <dt>Height: <dd> <meter min=0 max=10 value=2>2cm</meter>
! 1339: </dl></pre>
! 1340:
! 1341: </div><p>There is no explicit way to specify units in the
! 1342: <code><a href="#the-meter-element" id="meter_12">meter</a></code> element, but the units may be specified in the
! 1343: <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">
! 1344:
! 1345: <p>The example above could be extended to mention the units:</p>
! 1346:
! 1347: <pre><dl>
! 1348: <dt>Radius: <dd> <meter min=0 max=20 value=12 title="centimeters">12cm</meter>
! 1349: <dt>Height: <dd> <meter min=0 max=10 value=2 title="centimeters">2cm</meter>
! 1350: </dl></pre>
! 1351:
! 1352: </div><div class="example">
! 1353: <p>The following markup:</p>
! 1354: <pre><h3>Suggested groups</h3>
! 1355: <menu type="toolbar">
! 1356: <a href="?cmd=hsg" onclick="hideSuggestedGroups()">Hide suggested groups</a>
! 1357: </menu>
! 1358: <ul>
! 1359: <li>
! 1360: <p><a href="/group/comp.infosystems.www.authoring.stylesheets/view">comp.infosystems.www.authoring.stylesheets</a> -
! 1361: <a href="/group/comp.infosystems.www.authoring.stylesheets/subscribe">join</a></p>
! 1362: <p>Group description: <strong>Layout/presentation on the WWW.</strong></p>
! 1363: <p><strong><meter value="0.5">Moderate activity,</meter></strong> Usenet, 618 subscribers</p>
! 1364: </li>
! 1365: <li>
! 1366: <p><a href="/group/netscape.public.mozilla.xpinstall/view">netscape.public.mozilla.xpinstall</a> -
! 1367: <a href="/group/netscape.public.mozilla.xpinstall/subscribe">join</a></p>
! 1368: <p>Group description: <strong>Mozilla XPInstall discussion.</strong></p>
! 1369: <p><strong><meter value="0.25">Low activity,</meter></strong> Usenet, 22 subscribers</p>
! 1370: </li>
! 1371: <li>
! 1372: <p><a href="/group/mozilla.dev.general/view">mozilla.dev.general</a> -
! 1373: <a href="/group/mozilla.dev.general/subscribe">join</a></p>
! 1374: <p><strong><meter value="0.25">Low activity,</meter></strong> Usenet, 66 subscribers</p>
! 1375: </li>
! 1376: </ul></pre>
! 1377: <p>Might be rendered as follows:</p>
! 1378: <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>
! 1379: </div><p>User agents combine the value of
! 1380: the <code title="attr-title"><a href="elements.html#the-title-attribute" id="title_28">title</a></code> attribute and the other
! 1381: attributes to provide context-sensitive help or inline text
! 1382: detailing the actual values.<div class="example">
! 1383: <p>For example, the following snippet:</p>
! 1384: <pre><meter min=0 max=60 value=23.2 title=seconds></meter></pre>
! 1385: <p>...might cause the user agent to display a gauge with a tooltip
! 1386: saying "Value: 23.2 out of 60." on one line and "seconds" on a
! 1387: second line.</p>
! 1388: </div><div class="example">
! 1389:
! 1390: <p>The following example shows how a gauge could fall back to
! 1391: localized or pretty-printed text.</p>
! 1392:
! 1393: <pre><p>Disk usage: <meter min=0 value=170261928 max=233257824>170 261 928 bytes used
! 1394: out of 233 257 824 bytes available</meter></p></pre>
! 1395:
1.160 mike 1396: </div>
Webmaster