HTML.lt;button-value property

HTML button value property HTML slt;button-and-label

The value property is used to set the initial value of the HTML form button, as in the following reference example, and we set two with different initial values

The two buttons have the same name and submit different values when you click them:

<form action="demo_form.html"method="get">
Choose your favorite subject:
<button name="subject" type="submit" value="fav_HTML">HTML</button>
<button name="subject" type="submit" value="fav_CSS">CSS</button>
</form>

Try it out . . .

Browser support

HTML button value property HTML button value property HTML button value property HTML button value property HTML button value property

Value property is supported by all major browsers.

Important: If you use the button element in an HTML form, different browsers submit different values. I nternet Explorer will submit text between slt;button and slt;button;gt; and other browsers will submit the contents of the value property. Use input elements in HTML forms to create buttons.


Definitions and usages

The value property specifies the initial value of the .lt;form>

Note: In a form, if a button is submitted as form data, only the form's value is submitted.


The difference between HTML 4.01 and HTML5

No.


Grammar

<button value="value">

The property value

value describe
value The initial value of the button.


HTML button value property HTML slt;button-and-label