Easy Tutorial
❮ Att Tr Valign Att Select Form ❯

HTML <button> name Attribute

HTML <button> Tag

Example

Two buttons with the same name submit different values when clicked:


Browser Support

All major browsers support the name attribute.


Definition and Usage

The name attribute specifies a name for the button.

The name attribute is used to reference elements in JavaScript, or to reference form data after a form is submitted.

Tip: Different <button> elements can share the same name. This allows you to mark several buttons with the same name to submit different values when used in a form.


Differences Between HTML 4.01 and HTML5

NONE.


Syntax

Attribute Values

Value Description
name Specifies the name of the button.

❮ Att Tr Valign Att Select Form ❯