HTML <button> with name Attribute

You are Here:

HTML <button> with name Attribute

The name attribute specifies a name for the button.

The value of the name attribute is submitted as a pair with the button’s value as part of the form-data.

Note: Several <button> elements can share the same name with type="submit".

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <h2>Choose Your Gender</h2> <form action="/gender.php" method="get"> <button name="gender" type="submit" value="Male">Male</button> <button name="gender" type="submit" value="Female">Female</button> <button name="gender" type="submit" value="Other">Other</button> </form> </body> </html>

Attribute Value

ValueExplanation
nameSpecifies the name of the Key for the value in the input.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author