Reference /Pin to ProfileBookmark

The button tag defines an interactive element that performs an action when activated.

Syntax

The type attribute should always be specified, so the browser will know what type of button it is.

<button type="button">Click Me</button>

Attributes

autofocus
Designates that a button should focus on page load.

disabled
Designates that a button should be disabled.

form
Tells the browser which form ID the the button belongs to.

formaction
Provides the URL to send the form data when a form is submitted and the button type="submit".

formenctype
Provides the method of encoding used (application/x-www-form-urlencoded, multipart/form-data, or text/plain) for the form-data before sending it to a server. Only used when button type="submit".

formmethod
Designates which HTTP method to use (get or post) to send the form-data. Only used when button type="submit".

formnovalidate
Specifies to not validate the form-data when it is submitted. Only used when button type="submit".

formtarget
Designates where to open the form response after submission (_blank, _self, _parent, or _top). Only used when button type="submit".

name
Designates the button’s name.

type
Designates what type of button it is (button, reset, or submit).

value
Designates the initial value for the button.

Browser Compatibilty

Demos

Have a code example of <button>? Submit a codepen.io demo and we'll showcase it here

to submit a demo.
HTML
×

Success!

Help @reference spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with Github
about: ({
version: 0.1.7 BETA 2.4,
whats_new: article editor v2,
up_next: tip code demos,
coming_soon: embeddable tipping,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh

version: 0.1.5,
notes: added pins + new badge

version: 0.1.4,
notes: home refresh + tools
)...
recent_tips: (
tipper: @JohnDavis,
amount: 250 SATS,
source: article

tipper: @Megan0910,
amount: 1000 SATS,
source: article

tipper: @JohnDavis,
amount: 250 SATS,
source: article
)...