HTML - <input type="button">

The HTML <input type="button"> element is a specific version of the <input> element used to create a clickable button with no default value. It has been superseded in HTML5 by the <button> element.

Example

 

This creates a new button input with the label 'Click me'. 

HTML
<input type="button" value="Click me">

Description  

The HTML <input type="button"> element is a specific version of the <input> element used to create a clickable button with no default value. It has been superseded in HTML5 by the <button> element.

Browsers generate a control for a clickable button with no default value. The button can have any label on it. The control itself varies from one browser to another.

Content categories Flow content, phrasing content, Interactive content, listed, labelable, and submittable form-associated element, palpable content.
Permitted content Phrasing content.
Tag omission None, both the starting and ending tag are mandatory.
Permitted parent elements Any element that accepts phrasing content.
DOM interface HTMLButtonElement
Element type Inline

Browser Compatibility  

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support 1.0 1.0 (1.7 or earlier) (Yes) (Yes) (Yes)
formenctype attribute 9.0 4.0 (2.0) 10 10.6 ?
formmethod attribute 9.0 4.0 (2.0) 10 ? ?
autofocus attribute 9.0 4.0 (2.0) 10 9.6 5.0
formaction attribute 9.0 4.0 (2.0) 10 ? ?
Feature Android Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support (Yes) 1.0 (1.0) (Yes) (Yes) (Yes)
formenctype attribute ? 4.0 (2.0) ? ? ?
formmethod attribute ? 4.0 (2.0) ? ? ?
formaction attribute ? 4.0 (2.0) ? ? ?

 

See Also  

 

  • The generic <input> element and the interface used to manipulate it, HTMLInputElement
  • The HTML5 replacement for <input type="button">, the <button> element.

Specifications  

Specification Status
WHATWG HTML Living Standard
The definition of '<button>' in that specification.
Living Standard
HTML5
The definition of '<button>' in that specification.
Recommendation
HTML 4.01 Specification
The definition of '<button>' in that specification.
Recommendation

License

© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/html/element/input/button

Element HTML Input Element Reference