Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Button name attribute

Input Button name attribute

Button Object Reference Button Object


Definition and Usage

The name attribute sets or returns the value of the name attribute of the button element.

The name attribute is used to send data to the server after form submission, or to reference form data in JavaScript.

Note: After form submission, only the name attribute of form elements is used to pass data values.

Syntax

Set the name attribute:

buttonObject.name="

name

"

Return the name attribute:

buttonObject.name


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the name property.


Example

Example

Display the name attribute value of the button:

Runoob Tutorial(runoob.com)

Try it »


Button Object Reference Button Object