HTML button value Attribute

Definition and Usage

The value attribute specifies the initial value of the button.
The button value can be changed by a script.
Important: Be careful when using the button element in a form. In a form the different browsers will submit different values. Internet Explorer will submit the text between the <button> and </button> tags, while other browsers will send the content of the value attribute. When in a form, use the input element instead.


<button value="value">

Syntax Example

<button value="option1">

Attribute Values

Value Description
value Specifies value of the button.

Browser Support

The attribute is supported in all major browsers except Internet Explorer. If the button is in a form, IE will treat the text between the <button> and </button> tags as value.
HTML button value Attribute Reviewed by 1000sourcecodes on 06:12 Rating: 5
Powered by Blogger.