Input Button value Property
Button Object
Definition and Usage
The value property sets or returns the value of the value attribute of a button.
The value attribute defines the text that is displayed on the button.
Syntax
Set the value property:
buttonObject.value="value"
Return the value property:
Browser Support

The value property is supported in all major browsers.
Example
Example
Display the text on the button:
<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("button1").value;
alert(x);
}
</script>
</head>
<body>
<form>
<input type="button" onclick="displayResult()" value="Display
text
on button" id="button1">
</form>
</body>
</html>
Try it yourself »
Button Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]