HTML DOM Input Button name Property Last Updated : 29 Jan, 2024 Comments Improve Suggest changes Like Article Like Report The Input Button name Property in HTML DOM is used to set or return the value of name attribute of a Button field. The name attribute is required for each input field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns the Input Button name property.buttonObject.nameIt is used to set the Input Button name property.buttonObject.name = nameProperty Values: It contains a single value name which defines the name of the Button field. Return Value: It returns a string value which represents the name of the Button field. Example 1: This example illustrates how to return Input Button name property. HTML <!DOCTYPE html> <html> <head> <title>HTML DOM Input Button name Property</title> </head> <body style="text-align:center;"> <h1>GeeksforGeeks</h1> <h2>HTML DOM Input Button name Property</h2> <input type="button" id="GFG" onclick="myGeeks()" name="Geek_button" value="Submit"> <p id="result"></p> <script> function myGeeks() { // Return Input Button name Property let btnName = document.getElementById("GFG").name; document.getElementById("result").innerHTML = btnName; } </script> </body> </html> Output: Example 2: This example illustrates how to set the Property. HTML <!DOCTYPE html> <html> <head> <title>HTML DOM Input Button name Property</title> </head> <body style="text-align:center;"> <h1>GeeksforGeeks</h1> <h2>HTML DOM Input Button name Property</h2> <input type="button" id="GFG" onclick="myGeeks()" name="Geek_button" value="Submit"> <p id="result"></p> <script> function myGeeks() { // Set Input Button name Property let btnName = document.getElementById("GFG") .name = "Hello Geeks"; document.getElementById("result").innerHTML = "Value of name attribute changed to " + btnName; } </script> </body> </html> Output: Supported Browsers: Chrome 1Edge 12Firefox 1Opera 15Safari 1 Comment More infoAdvertise with us Next Article HTML DOM Input Button name Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML | DOM Button name Property The DOM Button name Property is used to set or return the value of a name attribute of a button element. The name attribute is used to specify the name of the button and it is used to reference form data when it has been submitted by the user. It also refers to the element in the javascript. Syntax: 2 min read HTML | DOM Input Date name Property The Input Date name property is used for setting or returning the value of the name attribute of a date field. The form data which has been submitted to the server can be identified by the name attribute. The name attribute is also used for referencing form data on the client-side using JavaScript.S 2 min read HTML DOM Input Color name Property The DOM Input Color name Property in HTML DOM is used to set or return the value of the name attribute. The name attribute is required for each input color field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns the Inp 2 min read HTML | DOM Input Button form Property The DOM Input Button form Property in HTML DOM is used for returning the reference to the form containing the input Button field is. It is read only property that returns a form object on success. Syntax: buttonObject.form Return Values: It returns a string value which specify the reference of the f 1 min read HTML | DOM Input Datetime name Property The Input Datetime name property is used for setting or returning the value of the name attribute of a datetime field. The form data which has been submitted to the server can be identified by the name attribute. The name attribute is also used for referencing form data on the client-side using Java 2 min read HTML | DOM Input URL name Property The DOM Input URL name Property in HTML DOM is used to set or return the value of name attribute of a URL field. The name attribute is required for each input field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns the 2 min read HTML DOM Input tel name Property The input tel name property in HTML DOM is used to set or return the value of the name attribute of an input tel field. The name attribute is required for each input field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It retur 1 min read HTML | DOM Input DatetimeLocal name Property The Input DatetimeLocal name property is used to set or return the value of the name attribute of a datetimeLocal field. The form data which has been submitted to the server can be identified by the name attribute. The name attribute is also used for referencing form data on the client side using Ja 2 min read HTML | DOM Input Week name Property The Input Week name property in HTML DOM is used to set or return the value of the name attribute of an input week field. The name attribute is required for each input week field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: I 2 min read HTML | DOM Input Time name Property The DOM Input Time name Property in HTML DOM is used to set or return the value of name attribute of a Time field. The name attribute is required for each input field. If the name attribute is not specified in an input field then the data of that field would not be sent at all. Syntax: It returns th 2 min read Like