Annotation of html5/spec-author-view/the-button-element.html, revision 1.614
1.577 mike 1: <!doctype html>
1.614 ! mike 2: <html lang="en-US-x-Hixie" xml:lang="en-US-x-Hixie" xmlns="http://www.w3.org/1999/xhtml"><meta content="text-html; charset=utf-8" http-equiv="Content-Type"><meta content="HTML Tidy for HTML5 (experimental) for Linux/x86 http://github.com/w3c/tidy-html5/tree/c63cc39" name="generator"><title>4.10.8 The button element — HTML5</title><style href="style.css">
! 3:
! 4: <style type="text-css">
1.613 mike 5: /**/
6: /**/
1.605 mike 7: pre { margin-left: 2em; white-space: pre-wrap; }
8: h2 { margin: 3em 0 1em 0; }
9: h3 { margin: 2.5em 0 1em 0; }
10: h4 { margin: 2.5em 0 0.75em 0; }
11: h5, h6 { margin: 2.5em 0 1em; }
12: h1 + h2, h1 + h2 + h2 { margin: 0.75em 0 0.75em; }
13: h2 + h3, h3 + h4, h4 + h5, h5 + h6 { margin-top: 0.5em; }
14: p { margin: 1em 0; }
15: hr:not(.top) { display: block; background: none; border: none; padding: 0; margin: 2em 0; height: auto; }
16: dl, dd { margin-top: 0; margin-bottom: 0; }
17: dt { margin-top: 0.75em; margin-bottom: 0.25em; clear: left; }
18: dt + dt { margin-top: 0; }
19: dd dt { margin-top: 0.25em; margin-bottom: 0; }
20: dd p { margin-top: 0; }
21: dd dl + p { margin-top: 1em; }
22: dd table + p { margin-top: 1em; }
23: p + * > li, dd li { margin: 1em 0; }
24: dt, dfn { font-weight: bold; font-style: normal; }
25: i, em { font-style: italic; }
26: dt dfn { font-style: italic; }
27: pre, code { font-size: inherit; font-family: monospace; font-variant: normal; }
28: pre strong { color: black; font: inherit; font-weight: bold; background: yellow; }
29: pre em { font-weight: bolder; font-style: normal; }
30: @media screen { code { color: orangered; } code :link, code :visited { color: inherit; } }
31: var sub { vertical-align: bottom; font-size: smaller; position: relative; top: 0.1em; }
32: table { border-collapse: collapse; border-style: hidden hidden none hidden; }
33: table thead, table tbody { border-bottom: solid; }
34: table tbody th:first-child { border-left: solid; }
35: table tbody th { text-align: left; }
36: table td, table th { border-left: solid; border-right: solid; border-bottom: solid thin; vertical-align: top; padding: 0.2em; }
37: blockquote { margin: 0 0 0 2em; border: 0; padding: 0; font-style: italic; }
38:
39: .bad, .bad *:not(.XXX) { color: gray; border-color: gray; background: transparent; }
40: .matrix, .matrix td { border: none; text-align: right; }
41: .matrix { margin-left: 2em; }
42: .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
43: .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
44: .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
45:
46: .toc dfn, h1 dfn, h2 dfn, h3 dfn, h4 dfn, h5 dfn, h6 dfn { font: inherit; }
47: img.extra, p.overview { float: right; }
48: pre.idl { border: solid thin; background: #EEEEEE; color: black; padding: 0.5em 1em; position: relative; }
49: pre.idl :link, pre.idl :visited { color: inherit; background: transparent; }
50: pre.idl::before { content: "IDL"; font: bold small sans-serif; padding: 0.5em; background: white; position: absolute; top: 0; margin: -1px 0 0 -4em; width: 1.5em; border: thin solid; border-radius: 0 0 0 0.5em }
51: pre.css { border: solid thin; background: #FFFFEE; color: black; padding: 0.5em 1em; }
52: pre.css:first-line { color: #AAAA50; }
53: dl.domintro { color: green; margin: 2em 0 2em 2em; padding: 0.5em 1em; border: none; background: #DDFFDD; }
54: hr + dl.domintro, div.impl + dl.domintro { margin-top: 2.5em; margin-bottom: 1.5em; }
55: dl.domintro dt, dl.domintro dt * { color: black; text-decoration: none; }
56: dl.domintro dd { margin: 0.5em 0 1em 2em; padding: 0; }
57: dl.domintro dd p { margin: 0.5em 0; }
58: dl.domintro:before { display: table; margin: -1em -0.5em -0.5em auto; width: auto; content: 'This box is non-normative. Implementation requirements are given below this box.'; color: black; font-style: italic; border: solid 2px; background: white; padding: 0 0.25em; }
59: dl.switch { padding-left: 2em; }
60: dl.switch > dt { text-indent: -1.5em; }
61: dl.switch > dt:before { content: '\21AA'; padding: 0 0.5em 0 0; display: inline-block; width: 1em; text-align: right; line-height: 0.5em; }
62: dl.triple { padding: 0 0 0 1em; }
63: dl.triple dt, dl.triple dd { margin: 0; display: inline }
64: dl.triple dt:after { content: ':'; }
65: dl.triple dd:after { content: '\A'; white-space: pre; }
66: .diff-old { text-decoration: line-through; color: silver; background: transparent; }
67: .diff-chg, .diff-new { text-decoration: underline; color: green; background: transparent; }
68: a .diff-new { border-bottom: 1px blue solid; }
69:
1.613 mike 70: figure.diagrams { border: double black; background: white; padding: 1em; }
71: figure.diagrams img { display: block; margin: 1em auto; }
72:
1.605 mike 73: h2 { page-break-before: always; }
74: h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }
75: h1 + h2, hr + h2.no-toc { page-break-before: auto; }
76:
77: p > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]),
78: li > span:not([title=""]):not([class="XXX"]):not([class="impl"]):not([class="note"]), { border-bottom: solid #9999CC; }
79:
80: div.head { margin: 0 0 1em; padding: 1em 0 0 0; }
81: div.head p { margin: 0; }
82: div.head h1 { margin: 0; }
83: div.head .logo { float: right; margin: 0 1em; }
84: div.head .logo img { border: none } /* remove border from top image */
85: div.head dl { margin: 1em 0; }
86: div.head p.copyright, div.head p.alt { font-size: x-small; font-style: oblique; margin: 0; }
87:
88: body > .toc > li { margin-top: 1em; margin-bottom: 1em; }
89: body > .toc.brief > li { margin-top: 0.35em; margin-bottom: 0.35em; }
90: body > .toc > li > * { margin-bottom: 0.5em; }
91: body > .toc > li > * > li > * { margin-bottom: 0.25em; }
92: .toc, .toc li { list-style: none; }
93:
94: .brief { margin-top: 1em; margin-bottom: 1em; line-height: 1.1; }
95: .brief li { margin: 0; padding: 0; }
96: .brief li p { margin: 0; padding: 0; }
97:
98: .category-list { margin-top: -0.75em; margin-bottom: 1em; line-height: 1.5; }
99: .category-list::before { content: '\21D2\A0'; font-size: 1.2em; font-weight: 900; }
100: .category-list li { display: inline; }
101: .category-list li:not(:last-child)::after { content: ', '; }
102: .category-list li > span, .category-list li > a { text-transform: lowercase; }
1.613 mike 103: .category-list li * { text-transform: none; } /* don't */
1.605 mike 104:
105: .XXX { color: #E50000; background: white; border: solid red; padding: 0.5em; margin: 1em 0; }
106: .XXX > :first-child { margin-top: 0; }
107: p .XXX { line-height: 3em; }
108: .annotation { border: solid thin black; background: #0C479D; color: white; position: relative; margin: 8px 0 20px 0; }
109: .annotation:before { position: absolute; left: 0; top: 0; width: 100%; height: 100%; margin: 6px -6px -6px 6px; background: #333333; z-index: -1; content: ''; }
110: .annotation :link, .annotation :visited { color: inherit; }
111: .annotation :link:hover, .annotation :visited:hover { background: transparent; }
112: .annotation span { border: none ! important; }
113: .note { color: green; background: transparent; font-family: sans-serif; }
114: .warning { color: red; background: transparent; }
115: .note, .warning { font-weight: bolder; font-style: italic; }
116: .note em, .warning em, .note i, .warning i { font-style: normal; }
117: p.note, div.note { padding: 0.5em 2em; }
118: span.note { padding: 0 2em; }
119: .note p:first-child, .warning p:first-child { margin-top: 0; }
120: .note p:last-child, .warning p:last-child { margin-bottom: 0; }
121: .warning:before { font-style: normal; }
122: p.note:before { content: 'Note: '; }
123: p.warning:before { content: '\26A0 Warning! '; }
124:
125: .bookkeeping:before { display: block; content: 'Bookkeeping details'; font-weight: bolder; font-style: italic; }
126: .bookkeeping { font-size: 0.8em; margin: 2em 0; }
127: .bookkeeping p { margin: 0.5em 2em; display: list-item; list-style: square; }
128: .bookkeeping dt { margin: 0.5em 2em 0; }
129: .bookkeeping dd { margin: 0 3em 0.5em; }
130:
131: h4 { position: relative; z-index: 3; }
132: h4 + .element, h4 + div + .element { margin-top: -2.5em; padding-top: 2em; }
133: .element {
134: background: #EEEEFF;
135: color: black;
136: margin: 0 0 1em 0.15em;
137: padding: 0 1em 0.25em 0.75em;
138: border-left: solid #9999FF 0.25em;
139: position: relative;
140: z-index: 1;
141: }
142: .element:before {
143: position: absolute;
144: z-index: 2;
145: top: 0;
146: left: -1.15em;
147: height: 2em;
148: width: 0.9em;
149: background: #EEEEFF;
150: content: ' ';
151: border-style: none none solid solid;
152: border-color: #9999FF;
153: border-width: 0.25em;
154: }
155:
156: .example { display: block; color: #222222; background: #FCFCFC; border-left: double; margin-left: 2em; padding-left: 1em; }
157: td > .example:only-child { margin: 0 0 0 0.1em; }
158:
159: ul.domTree, ul.domTree ul { padding: 0 0 0 1em; margin: 0; }
160: ul.domTree li { padding: 0; margin: 0; list-style: none; position: relative; }
161: ul.domTree li li { list-style: none; }
162: 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; }
163: 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; }
164: ul.domTree span { font-style: italic; font-family: serif; }
165: ul.domTree .t1 code { color: purple; font-weight: bold; }
166: ul.domTree .t2 { font-style: normal; font-family: monospace; }
167: ul.domTree .t2 .name { color: black; font-weight: bold; }
168: ul.domTree .t2 .value { color: blue; font-weight: normal; }
169: ul.domTree .t3 code, .domTree .t4 code, .domTree .t5 code { color: gray; }
170: ul.domTree .t7 code, .domTree .t8 code { color: green; }
171: ul.domTree .t10 code { color: teal; }
172:
173: body.dfnEnabled dfn { cursor: pointer; }
174: .dfnPanel {
175: display: inline;
176: position: absolute;
177: z-index: 10;
178: height: auto;
179: width: auto;
180: padding: 0.5em 0.75em;
181: font: small sans-serif, Droid Sans Fallback;
182: background: #DDDDDD;
183: color: black;
184: border: outset 0.2em;
185: }
186: .dfnPanel * { margin: 0; padding: 0; font: inherit; text-indent: 0; }
187: .dfnPanel :link, .dfnPanel :visited { color: black; }
188: .dfnPanel p { font-weight: bolder; }
189: .dfnPanel * + p { margin-top: 0.25em; }
190: .dfnPanel li { list-style-position: inside; }
191:
192: #configUI { position: absolute; z-index: 20; top: 10em; right: 1em; width: 11em; font-size: small; }
193: #configUI p { margin: 0.5em 0; padding: 0.3em; background: #EEEEEE; color: black; border: inset thin; }
194: #configUI p label { display: block; }
195: #configUI #updateUI, #configUI .loginUI { text-align: center; }
196: #configUI input[type=button] { display: block; margin: auto; }
197:
198: fieldset { margin: 1em; padding: 0.5em 1em; }
199: fieldset > legend + * { margin-top: 0; }
200: fieldset > :last-child { margin-bottom: 0; }
201: fieldset p { margin: 0.5em 0; }
202:
1.613 mike 203: .stability {
204: position: fixed;
205: bottom: 0;
206: left: 0; right: 0;
207: margin: 0 auto 0 auto;
208: width: 50%;
209: background: maroon; color: yellow;
210: -webkit-border-radius: 1em 1em 0 0;
211: -moz-border-radius: 1em 1em 0 0;
212: border-radius: 1em 1em 0 0;
213: -moz-box-shadow: 0 0 1em #500;
214: -webkit-box-shadow: 0 0 1em #500;
215: box-shadow: 0 0 1em red;
216: padding: 0.5em 1em;
217: text-align: center;
218: }
219: .stability strong {
220: display: block;
221: }
222: .stability input {
223: appearance: none; margin: 0; border: 0; padding: 0.25em 0.5em; background: transparent; color: black;
224: position: absolute; top: -0.5em; right: 0; font: 1.25em sans-serif; text-align: center;
225: }
226: .stability input:hover {
227: color: white;
228: text-shadow: 0 0 2px black;
229: }
230: .stability input:active {
231: padding: 0.3em 0.45em 0.2em 0.55em;
232: }
233: .stability :link, .stability :visited,
234: .stability :link:hover, .stability :visited:hover {
235: background: transparent;
236: color: white;
237: }
238:
239: /**/
240: /**/
241: </style><link href="http://www.w3.org/StyleSheets/TR/W3C-WD" rel="stylesheet" type="text-css"><meta content="noindex" name="robots"><style type="text-css">
242: /**/
243: /**/
1.1 mike 244:
245: .applies thead th > * { display: block; }
246: .applies thead code { display: block; }
247: .applies tbody th { whitespace: nowrap; }
248: .applies td { text-align: center; }
249: .applies .yes { background: yellow; }
250:
1.136 mike 251: .matrix, .matrix td { border: hidden; text-align: right; }
1.1 mike 252: .matrix { margin-left: 2em; }
253:
254: .dice-example { border-collapse: collapse; border-style: hidden solid solid hidden; border-width: thin; margin-left: 3em; }
255: .dice-example caption { width: 30em; font-size: smaller; font-style: italic; padding: 0.75em 0; text-align: left; }
256: .dice-example td, .dice-example th { border: solid thin; width: 1.35em; height: 1.05em; text-align: center; padding: 0; }
257:
1.213 mike 258: td.eg { border-width: thin; text-align: center; }
259:
1.1 mike 260: #table-example-1 { border: solid thin; border-collapse: collapse; margin-left: 3em; }
261: #table-example-1 * { font-family: "Essays1743", serif; line-height: 1.01em; }
262: #table-example-1 caption { padding-bottom: 0.5em; }
263: #table-example-1 thead, #table-example-1 tbody { border: none; }
264: #table-example-1 th, #table-example-1 td { border: solid thin; }
265: #table-example-1 th { font-weight: normal; }
266: #table-example-1 td { border-style: none solid; vertical-align: top; }
267: #table-example-1 th { padding: 0.5em; vertical-align: middle; text-align: center; }
268: #table-example-1 tbody tr:first-child td { padding-top: 0.5em; }
269: #table-example-1 tbody tr:last-child td { padding-bottom: 1.5em; }
270: #table-example-1 tbody td:first-child { padding-left: 2.5em; padding-right: 0; width: 9em; }
271: #table-example-1 tbody td:first-child::after { content: leader(". "); }
272: #table-example-1 tbody td { padding-left: 2em; padding-right: 2em; }
273: #table-example-1 tbody td:first-child + td { width: 10em; }
274: #table-example-1 tbody td:first-child + td ~ td { width: 2.5em; }
275: #table-example-1 tbody td:first-child + td + td + td ~ td { width: 1.25em; }
276:
277: .apple-table-examples { border: none; border-collapse: separate; border-spacing: 1.5em 0em; width: 40em; margin-left: 3em; }
278: .apple-table-examples * { font-family: "Times", serif; }
279: .apple-table-examples td, .apple-table-examples th { border: none; white-space: nowrap; padding-top: 0; padding-bottom: 0; }
280: .apple-table-examples tbody th:first-child { border-left: none; width: 100%; }
281: .apple-table-examples thead th:first-child ~ th { font-size: smaller; font-weight: bolder; border-bottom: solid 2px; text-align: center; }
282: .apple-table-examples tbody th::after, .apple-table-examples tfoot th::after { content: leader(". ") }
283: .apple-table-examples tbody th, .apple-table-examples tfoot th { font: inherit; text-align: left; }
284: .apple-table-examples td { text-align: right; vertical-align: top; }
285: .apple-table-examples.e1 tbody tr:last-child td { border-bottom: solid 1px; }
1.9 mike 286: .apple-table-examples.e1 tbody + tbody tr:last-child td { border-bottom: double 3px; }
287: .apple-table-examples.e2 th[scope=row] { padding-left: 1em; }
288: .apple-table-examples sup { line-height: 0; }
289:
1.11 mike 290: .details-example img { vertical-align: top; }
291:
1.386 mike 292: #base64-table {
293: white-space: nowrap;
294: font-size: 0.6em;
295: column-width: 6em;
296: column-count: 5;
297: column-gap: 1em;
298: -moz-column-width: 6em;
299: -moz-column-count: 5;
300: -moz-column-gap: 1em;
301: -webkit-column-width: 6em;
302: -webkit-column-count: 5;
303: -webkit-column-gap: 1em;
304: }
305: #base64-table thead { display: none; }
306: #base64-table * { border: none; }
307: #base64-table tbody td:first-child:after { content: ':'; }
308: #base64-table tbody td:last-child { text-align: right; }
309:
1.26 mike 310: #named-character-references-table {
1.257 mike 311: white-space: nowrap;
1.26 mike 312: font-size: 0.6em;
1.257 mike 313: column-width: 30em;
1.26 mike 314: column-gap: 1em;
1.257 mike 315: -moz-column-width: 30em;
1.26 mike 316: -moz-column-gap: 1em;
1.257 mike 317: -webkit-column-width: 30em;
1.26 mike 318: -webkit-column-gap: 1em;
319: }
1.257 mike 320: #named-character-references-table > table > tbody > tr > td:first-child + td,
1.26 mike 321: #named-character-references-table > table > tbody > tr > td:last-child { text-align: center; }
322: #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 323: #named-character-references-table > table > tbody > tr#entity-CounterClockwiseContourIntegral > td:first-child { font-size: 0.5em; }
1.26 mike 324:
1.35 mike 325: .glyph.control { color: red; }
326:
1.38 mike 327: @font-face {
328: font-family: 'Essays1743';
1.613 mike 329: src: url('fonts/Essays1743.ttf');
1.38 mike 330: }
331: @font-face {
332: font-family: 'Essays1743';
333: font-weight: bold;
1.613 mike 334: src: url('fonts/Essays1743-Bold.ttf');
1.38 mike 335: }
336: @font-face {
337: font-family: 'Essays1743';
338: font-style: italic;
1.613 mike 339: src: url('fonts/Essays1743-Italic.ttf');
1.38 mike 340: }
341: @font-face {
342: font-family: 'Essays1743';
343: font-style: italic;
344: font-weight: bold;
1.613 mike 345: src: url('fonts/Essays1743-BoldItalic.ttf');
346: }
347:
348: /**/
349: /**/
350: </style><link href="data:text/css," id="complete" rel="stylesheet" title="Complete specification"><link href="data:text/css,.impl%20{%20display:%20none;%20}%0Ahtml%20{%20border:%20solid%20yellow;%20}%20.domintro:before%20{%20display:%20none;%20}" id="author" rel="alternate stylesheet" title="Author documentation only"><link href="data:text/css,.impl%20{%20background:%20%23FFEEEE;%20}%20.domintro:before%20{%20background:%20%23FFEEEE;%20}" id="highlight" rel="alternate stylesheet" title="Highlight implementation requirements"><script>
351:
352:
353: function getCookie(name) {
354: var params = location.search.substr(1).split("&");
355: for (var index = 0; index < params.length; index++) {
356: if (params[index] == name)
357: return "1";
358: var data = params[index].split("=");
359: if (data[0] == name)
360: return unescape(data[1]);
361: }
362: var cookies = document.cookie.split("; ");
363: for (var index = 0; index < cookies.length; index++) {
364: var data = cookies[index].split("=");
365: if (data[0] == name)
366: return unescape(data[1]);
367: }
368: return null;
1.38 mike 369: }
370:
1.613 mike 371:
372: </script><link href="common-input-element-apis.html" rel="prev" title="4.10.7.3 Common input element APIs">
1.578 mike 373: <link href="Overview.html#contents" rel="contents" title="Table of contents">
1.570 mike 374: <link href="the-select-element.html" rel="next" title="4.10.9 The select element">
1.613 mike 375: <body class="split chapter" onload="fixBrokenLink();"><div class="head" id="head" xmlns="">
1.469 mike 376: <div aria-haspopup="true" id="jumpIndexA-button" role="button" tabindex="0">jump
1.613 mike 377: <div id="jumpIndexA">
378: <ul><li><a class="noindex" href="the-a-element.html#the-a-element">a</a><a class="noindex" href="the-abbr-element.html#the-abbr-element">abbr</a><a class="noindex" href="the-address-element.html#the-address-element">address</a><a class="noindex" href="the-area-element.html#the-area-element">area</a><a class="noindex" href="the-article-element.html#the-article-element">article</a><a class="noindex" href="the-aside-element.html#the-aside-element">aside</a><a class="noindex" href="the-audio-element.html#the-audio-element">audio</a></li>
379: </ul><ul><li><a class="noindex" href="the-b-element.html#the-b-element">b</a><a class="noindex" href="the-base-element.html#the-base-element">base</a><a class="noindex" href="the-bdi-element.html#the-bdi-element">bdi</a><a class="noindex" href="the-bdo-element.html#the-bdo-element">bdo</a><a class="noindex" href="the-blockquote-element.html#the-blockquote-element">blockquote</a><a class="noindex" href="the-body-element.html#the-body-element">body</a><a class="noindex" href="the-br-element.html#the-br-element">br</a><a class="noindex" href="#the-button-element">button</a></li>
380: </ul><ul><li><a class="noindex" href="the-canvas-element.html#the-canvas-element">canvas</a><a class="noindex" href="the-caption-element.html#the-caption-element">caption</a><a class="noindex" href="the-cite-element.html#the-cite-element">cite</a><a class="noindex" href="the-code-element.html#the-code-element">code</a><a class="noindex" href="the-col-element.html#the-col-element">col</a><a class="noindex" href="the-colgroup-element.html#the-colgroup-element">colgroup</a><a class="noindex" href="the-command-element.html#the-command-element">command</a></li>
381: </ul><ul><li><a class="noindex" href="the-datalist-element.html#the-datalist-element">datalist</a><a class="noindex" href="the-dd-element.html#the-dd-element">dd</a><a class="noindex" href="the-del-element.html#the-del-element">del</a><a class="noindex" href="the-details-element.html#the-details-element">details</a><a class="noindex" href="the-dfn-element.html#the-dfn-element">dfn</a><a class="noindex" href="the-div-element.html#the-div-element">div</a><a class="noindex" href="the-dl-element.html#the-dl-element">dl</a><a class="noindex" href="the-dt-element.html#the-dt-element">dt</a></li>
382: </ul><ul><li><a class="noindex" href="the-em-element.html#the-em-element">em</a><a class="noindex" href="the-embed-element.html#the-embed-element">embed</a><a class="noindex" href="the-fieldset-element.html#the-fieldset-element">fieldset</a><a class="noindex" href="the-figcaption-element.html#the-figcaption-element">figcaption</a><a class="noindex" href="the-figure-element.html#the-figure-element">figure</a><a class="noindex" href="the-footer-element.html#the-footer-element">footer</a><a class="noindex" href="the-form-element.html#the-form-element">form</a></li>
383: </ul><ul><li><a class="full-spec-link" href="http://dev.w3.org/html5/spec/.html#the-h1-h2-h3-h4-h5-and-h6-elements" title='Read about this "h1" reference in the full HTML5 spec.'>h1</a><a class="full-spec-link" href="http://dev.w3.org/html5/spec/.html#the-h1-h2-h3-h4-h5-and-h6-elements" title='Read about this "h2" reference in the full HTML5 spec.'>h2</a><a class="full-spec-link" href="http://dev.w3.org/html5/spec/.html#the-h1-h2-h3-h4-h5-and-h6-elements" title='Read about this "h3" reference in the full HTML5 spec.'>h3</a><a class="full-spec-link" href="http://dev.w3.org/html5/spec/.html#the-h1-h2-h3-h4-h5-and-h6-elements" title='Read about this "h4" reference in the full HTML5 spec.'>h4</a><a class="full-spec-link" href="http://dev.w3.org/html5/spec/.html#the-h1-h2-h3-h4-h5-and-h6-elements" title='Read about this "h5" reference in the full HTML5 spec.'>h5</a><a class="full-spec-link" href="http://dev.w3.org/html5/spec/.html#the-h1-h2-h3-h4-h5-and-h6-elements" title='Read about this "h6" reference in the full HTML5 spec.'>h6</a><a class="noindex" href="the-head-element.html#the-head-element">head</a><a class="noindex" href="the-header-element.html#the-header-element">header</a><a class="noindex" href="the-hgroup-element.html#the-hgroup-element">hgroup</a><a class="noindex" href="the-hr-element.html#the-hr-element">hr</a><a class="noindex" href="the-html-element.html#the-html-element">html</a></li>
384: </ul><ul><li><a class="noindex" href="the-i-element.html#the-i-element">i</a><a class="noindex" href="the-iframe-element.html#the-iframe-element">iframe</a><a class="noindex" href="the-img-element.html#the-img-element">img</a><a class="noindex" href="the-input-element.html#the-input-element">input</a><a class="noindex" href="the-ins-element.html#the-ins-element">ins</a><a class="noindex" href="the-kbd-element.html#the-kbd-element">kbd</a><a class="noindex" href="the-keygen-element.html#the-keygen-element">keygen</a></li>
385: </ul><ul><li><a class="noindex" href="the-label-element.html#the-label-element">label</a><a class="noindex" href="the-legend-element.html#the-legend-element">legend</a><a class="noindex" href="the-li-element.html#the-li-element">li</a><a class="noindex" href="the-link-element.html#the-link-element">link</a><a class="noindex" href="the-map-element.html#the-map-element">map</a><a class="noindex" href="the-mark-element.html#the-mark-element">mark</a><a class="noindex" href="the-menu-element.html#the-menu-element">menu</a><a class="noindex" href="the-meta-element.html#the-meta-element">meta</a><a class="noindex" href="the-meter-element.html#the-meter-element">meter</a></li>
386: </ul><ul><li><a class="noindex" href="the-nav-element.html#the-nav-element">nav</a><a class="noindex" href="the-noscript-element.html#the-noscript-element">noscript</a><a class="noindex" href="the-object-element.html#the-object-element">object</a><a class="noindex" href="the-ol-element.html#the-ol-element">ol</a><a class="noindex" href="the-optgroup-element.html#the-optgroup-element">optgroup</a><a class="noindex" href="the-option-element.html#the-option-element">option</a><a class="noindex" href="the-output-element.html#the-output-element">output</a></li>
387: </ul><ul><li><a class="noindex" href="the-p-element.html#the-p-element">p</a><a class="noindex" href="the-param-element.html#the-param-element">param</a><a class="noindex" href="the-pre-element.html#the-pre-element">pre</a><a class="noindex" href="the-progress-element.html#the-progress-element">progress</a><a class="noindex" href="the-q-element.html#the-q-element">q</a><a class="noindex" href="the-rp-element.html#the-rp-element">rp</a><a class="noindex" href="the-rt-element.html#the-rt-element">rt</a><a class="noindex" href="the-ruby-element.html#the-ruby-element">ruby</a></li>
388: </ul><ul><li><a class="noindex" href="the-s-element.html#the-s-element">s</a><a class="noindex" href="the-samp-element.html#the-samp-element">samp</a><a class="noindex" href="the-script-element.html#the-script-element">script</a><a class="noindex" href="the-section-element.html#the-section-element">section</a><a class="noindex" href="the-select-element.html#the-select-element">select</a><a class="noindex" href="the-small-element.html#the-small-element">small</a><a class="noindex" href="the-source-element.html#the-source-element">source</a><a class="noindex" href="the-span-element.html#the-span-element">span</a></li>
389: </ul><ul><li><a class="noindex" href="the-strong-element.html#the-strong-element">strong</a><a class="noindex" href="the-style-element.html#the-style-element">style</a><a class="noindex" href="the-sub-and-sup-elements.html#the-sub-and-sup-elements">sub</a><a class="noindex" href="the-summary-element.html#the-summary-element">summary</a><a class="noindex" href="the-sub-and-sup-elements.html#the-sub-and-sup-elements">sup</a></li>
390: </ul><ul><li><a class="noindex" href="the-table-element.html#the-table-element">table</a><a class="noindex" href="the-tbody-element.html#the-tbody-element">tbody</a><a class="noindex" href="the-td-element.html#the-td-element">td</a><a class="noindex" href="the-textarea-element.html#the-textarea-element">textarea</a><a class="noindex" href="the-tfoot-element.html#the-tfoot-element">tfoot</a><a class="noindex" href="the-th-element.html#the-th-element">th</a><a class="noindex" href="the-thead-element.html#the-thead-element">thead</a><a class="noindex" href="the-time-element.html#the-time-element">time</a><a class="noindex" href="the-title-element.html#the-title-element">title</a></li>
391: </ul><ul><li><a class="noindex" href="the-tr-element.html#the-tr-element">tr</a><a class="noindex" href="the-track-element.html#the-track-element">track</a><a class="noindex" href="the-u-element.html#the-u-element">u</a><a class="noindex" href="the-ul-element.html#the-ul-element">ul</a><a class="noindex" href="the-var-element.html#the-var-element">var</a><a class="noindex" href="the-video-element.html#the-video-element">video</a><a class="noindex" href="the-wbr-element.html#the-wbr-element">wbr</a></li>
392: </ul><ul class="jumpIndexA-other"><li><a class="noindex" href="global-attributes.html#global-attributes">global
393: attributes</a><a class="noindex" href="index-of-terms.html#index-of-terms">terms</a></li>
394: </ul></div>
395: </div>
396: <script src="jump-indexes.js">
397: </script><p xmlns="http://www.w3.org/1999/xhtml"><a href="http://www.w3.org/"><img alt="W3C" height="48" src="http://www.w3.org/Icons/w3c_home" width="72"></a></p>
398: <h1 xmlns="http://www.w3.org/1999/xhtml">HTML5</h1>
399: </div>
400: <div class="prev_next">
1.612 mike 401: <a href="common-input-element-apis.html">← 4.10.7.3 Common input element APIs</a> –
1.160 mike 402: <a href="Overview.html#contents">Table of contents</a> –
1.612 mike 403: <a href="the-select-element.html">4.10.9 The select element →</a>
1.552 mike 404: </div>
1.156 mike 405:
1.613 mike 406: <h4 id="the-button-element"><span class="secno">4.10.8</span> The
407: <dfn><code>button</code></dfn> element</h4>
408: <dl class="element"><dt><a href="element-definitions.html#element-dfn-categories" id="element-dfn-categories_88" title="element-dfn-categories">Categories</a>:</dt>
409: <dd><a href="content-models.html#flow-content-1" id="flow-content_127">Flow
410: content</a>.</dd>
411: <dd><a href="content-models.html#phrasing-content-1" id="phrasing-content_126">Phrasing content</a>.</dd>
412: <dd><a href="content-models.html#interactive-content-0" id="interactive-content_15">Interactive content</a>.</dd>
413: <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
414: <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>
415: <dd><a href="content-models.html#palpable-content-0" id="palpable-content_54">Palpable
416: content</a>.</dd>
417: <dt><a href="element-definitions.html#element-dfn-contexts" id="element-dfn-contexts_88" title="element-dfn-contexts">Contexts in which this element can be
418: used</a>:</dt>
419: <dd>Where <a href="content-models.html#phrasing-content-1" id="phrasing-content_127">phrasing content</a> is expected.</dd>
420: <dt><a href="element-definitions.html#element-dfn-content-model" id="element-dfn-content-model_88" title="element-dfn-content-model">Content model</a>:</dt>
421: <dd><a href="content-models.html#phrasing-content-1" id="phrasing-content_128">Phrasing content</a>, but there must be no
422: <a href="content-models.html#interactive-content-0" id="interactive-content_16">interactive content</a> descendant.</dd>
423: <dt><a href="element-definitions.html#element-dfn-attributes" id="element-dfn-attributes_88" title="element-dfn-attributes">Content
424: attributes</a>:</dt>
425: <dd><a href="global-attributes.html#global-attributes" id="global-attributes_89">Global
426: attributes</a></dd>
427: <dd><code title="attr-fe-autofocus"><a href="attributes-common-to-form-controls.html#attr-fe-autofocus" id="autofocus_1">autofocus</a></code></dd>
428: <dd><code title="attr-fe-disabled"><a href="attributes-common-to-form-controls.html#attr-fe-disabled" id="disabled_13">disabled</a></code></dd>
429: <dd><code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form_52">form</a></code></dd>
430: <dd><code title="attr-fs-formaction"><a href="form-submission.html#attr-fs-formaction" id="formaction_26">formaction</a></code></dd>
431: <dd><code title="attr-fs-formenctype"><a href="form-submission.html#attr-fs-formenctype" id="formenctype_26">formenctype</a></code></dd>
432: <dd><code title="attr-fs-formmethod"><a href="form-submission.html#attr-fs-formmethod" id="formmethod_26">formmethod</a></code></dd>
433: <dd><code title="attr-fs-formnovalidate"><a href="form-submission.html#attr-fs-formnovalidate" id="formnovalidate_27">formnovalidate</a></code></dd>
434: <dd><code title="attr-fs-formtarget"><a href="form-submission.html#attr-fs-formtarget" id="formtarget_26">formtarget</a></code></dd>
435: <dd><code title="attr-fe-name"><a href="attributes-common-to-form-controls.html#attr-fe-name" id="name_37">name</a></code></dd>
436: <dd><code title="attr-button-type"><a href="#attr-button-type" id="type_83">type</a></code></dd>
437: <dd><code title="attr-button-value"><a href="#attr-button-value" id="value_30">value</a></code></dd>
438: <dt><a href="element-definitions.html#element-dfn-dom" id="element-dfn-dom_88" title="element-dfn-dom">DOM interface</a>:</dt>
439: <!--TOPIC:DOM APIs-->
440: <dd>
441: <pre class="idl">
442: interface <dfn id="htmlbuttonelement">HTMLButtonElement</dfn> : <a href="elements.html#htmlelement" id="htmlelement_95">HTMLElement</a> {
443: attribute boolean <a href="#dom-fe-autofocus" title="dom-fe-autofocus">autofocus</a>;
444: attribute boolean <a href="#dom-fe-disabled" title="dom-fe-disabled">disabled</a>;
445: readonly attribute <a href="the-form-element.html#htmlformelement" id="htmlformelement_5">HTMLFormElement</a>? <a href="#dom-fae-form" title="dom-fae-form">form</a>;
446: attribute DOMString <a href="#dom-fs-formaction" title="dom-fs-formAction">formAction</a>;
447: attribute DOMString <a href="#dom-fs-formenctype" title="dom-fs-formEnctype">formEnctype</a>;
448: attribute DOMString <a href="#dom-fs-formmethod" title="dom-fs-formMethod">formMethod</a>;
449: attribute boolean <a href="#dom-fs-formnovalidate" title="dom-fs-formNoValidate">formNoValidate</a>;
450: attribute DOMString <a href="#dom-fs-formtarget" title="dom-fs-formTarget">formTarget</a>;
451: attribute DOMString <a href="#dom-fe-name" title="dom-fe-name">name</a>;
452: attribute DOMString <a href="#dom-button-type" title="dom-button-type">type</a>;
453: attribute DOMString <a href="#dom-button-value" title="dom-button-value">value</a>;
454:
455: readonly attribute boolean <a href="#dom-cva-willvalidate" title="dom-cva-willValidate">willValidate</a>;
456: readonly attribute <a href="#validitystate">ValidityState</a> <a href="#dom-cva-validity" title="dom-cva-validity">validity</a>;
457: readonly attribute DOMString <a href="#dom-cva-validationmessage" title="dom-cva-validationMessage">validationMessage</a>;
458: boolean <a href="#dom-cva-checkvalidity" title="dom-cva-checkValidity">checkValidity</a>();
459: void <a href="#dom-cva-setcustomvalidity" title="dom-cva-setCustomValidity">setCustomValidity</a>(DOMString error);
460:
461: readonly attribute <a href="#nodelist">NodeList</a> <a href="#dom-lfe-labels" title="dom-lfe-labels">labels</a>;
462: };
463: </pre></dd>
464: </dl><!--TOPIC:HTML--><p>The <code><a href="#the-button-element" id="button_14">button</a></code> element <a href="#represents">represents</a> a button.</p>
465: <p>The element is a <a href="forms.html#concept-button" id="concept-button_4" title="concept-button">button</a>.</p>
466: <p>The <dfn id="attr-button-type" title="attr-button-type"><code>type</code></dfn> attribute controls the
467: behavior of the button when it is activated. It is an <a href="common-microsyntaxes.html#enumerated-attribute" id="enumerated-attribute_11">enumerated
468: attribute</a>. The following table lists the keywords and states
469: for the attribute — the keywords in the left column map to the
470: states in the cell in the second column on the same row as the
471: keyword.</p>
472: <table><thead><tr><th>Keyword</th>
473: <th>State</th>
474: <th>Brief description</th>
475: <tbody><tr><td><dfn id="attr-button-type-submit" title="attr-button-type-submit"><code>submit</code></dfn></td>
476: <td><a href="#attr-button-type-submit-state" title="attr-button-type-submit-state">Submit Button</a></td>
477: <td>Submits the form.</td>
478: <tr><td><dfn id="attr-button-type-reset" title="attr-button-type-reset"><code>reset</code></dfn></td>
479: <td><a href="#attr-button-type-reset-state" title="attr-button-type-reset-state">Reset Button</a></td>
480: <td>Resets the form.</td>
481: <tr><td><dfn id="attr-button-type-button" title="attr-button-type-button"><code>button</code></dfn></td>
482: <td><a href="#attr-button-type-button-state" title="attr-button-type-button-state">Button</a></td>
483: <td>Does nothing.</td>
484: </table><p>The <i>missing value default</i> is the <a href="#attr-button-type-submit-state" title="attr-button-type-submit-state">Submit Button</a> state.</p>
485: <p>If the <code title="attr-button-type"><a href="#attr-button-type" id="type_84">type</a></code> attribute is in
486: the <a href="#attr-button-type-submit-state" title="attr-button-type-submit-state">Submit Button</a> state, the
487: element is specifically a <a href="forms.html#concept-submit-button" id="concept-submit-button_2" title="concept-submit-button">submit
488: button</a>.</p>
489: <p>The <code title="attr-fae-form"><a href="association-of-controls-and-forms.html#attr-fae-form" id="form_53">form</a></code> attribute is used to explicitly associate
490: the <code><a href="#the-button-element" id="button_15">button</a></code> element with its <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="attributes-common-to-form-controls.html#attr-fe-name" id="name_38">name</a></code>
491: attribute represents the element's name. The <code title="attr-fe-disabled"><a href="attributes-common-to-form-controls.html#attr-fe-disabled" id="disabled_14">disabled</a></code> attribute is used to make the
492: control non-interactive and to prevent its value from being
493: submitted. The <code title="attr-fe-autofocus"><a href="attributes-common-to-form-controls.html#attr-fe-autofocus" id="autofocus_2">autofocus</a></code>
494: attribute controls focus. The <code title="attr-fs-formaction"><a href="form-submission.html#attr-fs-formaction" id="formaction_27">formaction</a></code>, <code title="attr-fs-formenctype"><a href="form-submission.html#attr-fs-formenctype" id="formenctype_27">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="form-submission.html#attr-fs-formmethod" id="formmethod_27">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="form-submission.html#attr-fs-formnovalidate" id="formnovalidate_28">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="form-submission.html#attr-fs-formtarget" id="formtarget_27">formtarget</a></code> attributes are <a href="form-submission.html#attributes-for-form-submission" id="attributes-for-form-submission_3">attributes for form
495: submission</a>.</p>
496: <p class="note">The <code title="attr-fs-formnovalidate"><a href="form-submission.html#attr-fs-formnovalidate" id="formnovalidate_29">formnovalidate</a></code> attribute can be used
497: to make submit buttons that do not trigger the constraint
498: validation.</p>
499: <p>The <code title="attr-fs-formaction"><a href="form-submission.html#attr-fs-formaction" id="formaction_28">formaction</a></code>,
500: <code title="attr-fs-formenctype"><a href="form-submission.html#attr-fs-formenctype" id="formenctype_28">formenctype</a></code>, <code title="attr-fs-formmethod"><a href="form-submission.html#attr-fs-formmethod" id="formmethod_28">formmethod</a></code>, <code title="attr-fs-formnovalidate"><a href="form-submission.html#attr-fs-formnovalidate" id="formnovalidate_30">formnovalidate</a></code>, and <code title="attr-fs-formtarget"><a href="form-submission.html#attr-fs-formtarget" id="formtarget_28">formtarget</a></code> must not be specified if the
501: element's <code title="attr-button-type"><a href="#attr-button-type" id="type_85">type</a></code> attribute is not
502: in the <a href="#attr-button-type-submit-state" title="attr-button-type-submit-state">Submit Button</a> state.</p>
503: <p>The <dfn id="attr-button-value" title="attr-button-value"><code>value</code></dfn> attribute gives the
504: element's value for the purposes of form submission. The element's
505: <a href="#concept-fe-value" title="concept-fe-value">value</a> is
506: the value of the element's <code title="attr-button-value"><a href="#attr-button-value" id="value_31">value</a></code> attribute, if
507: there is one, or the empty string otherwise.</p>
508: <p class="note">A button (and its value) is only included in the
509: form submission if the button itself was used to initiate the form
510: submission.</p>
511: <div class="example">
512: <p>The following button is labeled "Show hint" and pops up a dialog
513: box when activated:</p>
514: <pre>
515: <button type=button
1.9 mike 516: onclick="alert('This 15-20 minute piece was composed by George Gershwin.')">
517: Show hint
1.613 mike 518: </button>
519: </pre></div>
Webmaster