Language References
Specifies a container for rich HTML that is rendered as a button. | HTML 4, 4.01, 5 |
HTML Syntax
<button
accesskey = string
class = classname
datafld = colname
dataformatas = html | text
datasrc = #id
disabled
id = value
name = name
style = css properties
title = text
type = button | reset | submit
value = value
event = script
>
The BUTTON element creates buttons which function like buttons created with the INPUT element, but offer richer rendering possibilities. The BUTTON element may have content.
The type attribute specifies the visual appearance and default behavior of the button.
Though BUTTON can contain images, it is not valid to associate an image map with an IMG that appears as the contents of a BUTTON element.
Conforming browsers typically render BUTTON with relief and an up/down motion when clicked.
When the BUTTON object is submitted in a form, Microsoft® Internet Explorer® 5 and later submits the value, if it exists. Otherwise, the innerText is submitted. In Microsoft Internet Explorer® 4, only the innerText value is submitted.
BUTTON Members
The following example shows submit and reset buttons done with BUTTON instead of INPUT.
Below is the HTML fragment for the sample above.
<form>
<table>
...
<tr>
<td><button type="submit"
style="background:#036;color:gold;font:bold">
Send</button></td>
<td><button type="reset"
style="background:#800;color:gold;font:bold">
Reset</button></td></tr>
</table>
</form>
INPUT