HTML Button Tag


Advertisements


Description

The HTML <button> tag is used for creating a button within HTML form. You can also use <input> tag to create similar buttons.

Example

<!DOCTYPE html>
<html>
<head>
<title>HTML Button Tag</title>
</head>
<body>
<form>
<button name="button" value="OK" type="button">Click Me</button>
</form>
</body>
</html>

This will produce following result:

Global Attributes

This tag supports all the global attributes described in - HTML Attribute Reference

Specific Attributes

The HTML <button> tag also supports following additional attributes:

AttributeValueDescription
autofocus html-5autofocusSpecifies that the button should have input focus when the page loads.

Event Attributes

This tag supports all the event attributes described in - HTML Events Reference

Browser Support

ChromeFirefoxIEOperaSafari
YesYesYesYesYes

html_tag_reference.htm