HTML <button> tag
A button is marked up as follows:
<button type="button">Click Me!</button>
Try it yourself!
Definition and Usage
The <button> tag defines a push button.
Inside a button element you can put content,
like text or images. This is the difference between this element and buttons
created with the input element.
Always specify the type attribute for the button. The default
type for Internet Explorer is "button", while in other browsers (and the
W3C specification) it is "submit".
The <button> tag is supported in all major browsers.
Important: If you use the button element in an HTML form, different browsers will submit different values. Internet Explorer will
submit the text between the <button> and </button> tags, while other browsers
will submit the content of the value attribute. Use the input
element to create buttons in an HTML form.
Differences Between HTML and XHTML
DTD indicates in which DTD the attribute is
allowed. S=Strict, T=Transitional, and F=Frameset.
||Disables the button
||Specifies a name for the button
|Defines the type of button
||Specifies an initial value for the button. The value can be
changed by a script
|id, class, title, style, dir, lang, xml:lang, accesskey,
For a full description, go to Standard
| onfocus, onblur, onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup
For a full description, go to Event Attributes.
The Altova MissionKit is a suite of intelligent XML tools, including:
XMLSpy® – industry-leading XML editor
- Support for all XML-based technologies
- Graphical editing views, powerful debuggers, code generation, & more
MapForce® – graphical data mapping tool
- Drag-and-drop data conversion with code generation
- Support for XML, DBs, EDI, Excel® 2007, text, Web services
StyleVision® – visual stylesheet designer
- Drag-and-drop stylesheet design for XML & databases
- Output to HTML, PDF, RTF, Word 2007, & more
Try before you buy with a free fully functional 30-day trial
Get Your Diploma!
W3Schools' Online Certification Program is the perfect solution for busy
professionals who need to balance work, family, and career building.
The HTML Certificate is for developers who want to document their knowledge of HTML, XHTML, and CSS.
The XML Certificate is for developers who want to document their knowledge of XML, XML DOM and XSLT.
The ASP Certificate is for developers who want to document their knowledge of ASP, SQL, and ADO.
The PHP Certificate is for developers who want to document their knowledge of PHP and SQL (MySQL).