Submit valueProperty
Submit Object
Definition and Usage
The value property sets or returns the value of the value attribute of the submit button.
The value specifies the text displayed on the submit button.
Syntax
Set the value property:
submitObject.value="value"
Return the value property:
submitObject.value
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the value property.
Example
Example
The following example shows the text displayed on the submit button:
<html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("submit1").value;
alert(x);
}
</script>
</head>
<body>
<form>
Email: <input type="text" id="email">
<input type="submit" id="submit1" value="Submit form">
</form>
<button type="button" onclick="displayResult()">Display value</button>
</body>
</html>
<head>
<script>
function displayResult()
{
var x=document.getElementById("submit1").value;
alert(x);
}
</script>
</head>
<body>
<form>
Email: <input type="text" id="email">
<input type="submit" id="submit1" value="Submit form">
</form>
<button type="button" onclick="displayResult()">Display value</button>
</body>
</html>
Try it yourself »
Submit Object
Other Extensions