Submit valueProperty

Submit 对象参考手册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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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>

Try it yourself »


Submit 对象参考手册Submit Object Other Extensions