HTML DOM value Property
Complete Button Object Reference
Definition and Usage
The value property sets or returns the text that is displayed on the button.
Syntax
buttonObject.value=sometext
|
Example
<html>
<head>
<script type="text/javascript">
function alertValue()
{
alert(document.getElementById("myButton").value)
}
</script>
</head>
<body>
<form>
<input type="button" value="Click me!" id="myButton"
onclick="alertValue()" />
</form>
</body>
</html>
|
Try-It-Yourself Demos
Alert id, type, and value of a Button
+ disable button
Complete Button Object Reference
|