Change the text displayed on a button:
The value property sets or returns the value of the value attribute of an input button.
The value attribute defines the text that is displayed on the button.
The value property is supported in all major browsers.
Return the value property:
Set the value property:
Value | Description |
---|---|
text | The text displayed on the button |
Return Value: | A String, representing the text displayed on the input button |
---|
Get the text displayed on a button:
The result of x will be:
HTML reference: HTML <input> value attribute