Input Button name attribute
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





All major browsers support the name property.
Example
Example
Display the name attribute value of the button:
Try it »
Button Object