HTML <button> value Attribute

The value attribute on a submit <button> tag sets the value of the element. Its value is sent to the form-handler when the form is submitted.

Example

#

A value attribute on 3 submit <button> elements.
Clicking a button submits its value. These buttons function much like radio buttons.

<form action="/tutorial/action.html">
  <button name="score" type="submit" value="High">High</button>
  <button name="score" type="submit" value="Medium">Medium</button>
  <button name="score" type="submit" value="Low">Low</button>
</form>

Tip: Submit buttons with the same name but different values make it easy to identify the button that submitted the form. Click each of the above buttons to see what is submitted.


Using value

The value attribute specifies the value of the button.

For buttons of type submit the value is submitted when the button is clicked.

For buttons of type button or reset the value is not submitted. Generally, value is not used on these buttons.


Syntax

<button value="value">

Values

#

Value Description
value An alphanumeric string.

Browser support

Here is when value support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <button>
Guides