English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML: <button> value Attribute

The Value attribute specifies the initial value for <button> in <form>. Different browsers will submit different values when the button element is used in an HTML form. Internet Explorer will submit the content between <button> and <button/The text between > and < will be submitted, while other browsers will submit the content of the value attribute. Please use the input element to create buttons in HTML forms

 HTML <button> tag

Online Example

Two buttons with the same name will submit different values when clicked:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML <button> value Attribute Usage-Basic Tutorial(oldtoolbag.com)</title>
</head>
<body>
<form action="action_page.php" method="get">
Select the topic you want to follow:
<button name="subject" type="submit" value="fav_PHP">PHP</button>
<button name="subject" type="submit" value="fav_JAVA">JAVA</button>
</form>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the value attribute.

Important Note:If the button element is used in an HTML form, different browsers will submit different values. Internet Explorer will submit <button> with/The text between > and <, while other browsers will submit the content of the value attribute. Please use input elementto create a button.

Definition and Usage

The Value attribute specifies the initial value for the <button> in the <form>.

Note: In a form, only when the button itself is used to submit the form, the button and its value will be submitted.

HTML 4.01 With HTML5The difference

NONE.

Syntax

<button value="value">

Attribute value

ValueDescription
valueThe initial value of the button.
 HTML <button> tag