Example
A clickable button is marked up as follows:
<button type="button">Click Me!</button>
Definition and Usage
The <button> tag defines a clickable 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.
Tip: Always specify the type attribute for a <button> element. Different browsers use different default types for the <button> element.
Browser Support
Element | |||||
---|---|---|---|---|---|
<button> | Yes | Yes | Yes | Yes | Yes |
Tips and Notes
Note: If you use the <button> element in an HTML form, different browsers may submit different values. Use <input> to create buttons in an HTML form.Tip: Visit our CSS Buttons Tutorial to find out how to style buttons with CSS.