Search w3schools.com:

SHARE THIS PAGE

Submit value Property

Submit Object Reference Submit Object

Definition and Usage

The value property sets or returns the value of the value attribute of the submit button.

The value attribute defines the text that is displayed on the submit button.

Syntax

Set the value property:

submitObject.value="value"

Return the value property:

submitObject.value


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The value property is supported in all major browsers.


Example

Example

Display the value of 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 Object Reference Submit Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]