JavaScript » Button » value

Syntax:
button.value

This property sets or returns the button's value attribute. This is the text that is actually displayed on the button face.

Examples

Code:
<form name="myForm" title="myForm">
<INPUT NAME="myButton" TYPE="button" VALUE="Click to change value" onClick=valChange()>

<script type="text/javascript">
function valChange()      {
     document.myForm.myButton.value="Value has changed"
}
</script>
</form>
Explanation:

This code uses the button's onClick event handler to call a JavaScript function that changes the Value attribute of the Button..