Input Submit value Property - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Submit

Description

The value property sets or gets the value attribute of the submit button, which is the text displayed on the submit button.

Set the value property with the following Values

Value Description
text The text displayed on the submit button

Return Value

A String, representing the text displayed on the submit button

The following code shows how to change the text displayed on a Submit button:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

<input type="submit" id="mySubmit" value="Submit form">

<button onclick="myFunction()">Test</button>

<script>
function myFunction() {/*from  w w w .ja  v  a 2  s.c  o m*/
    document.getElementById("mySubmit").value = "newSubmitButtonValue";
}
</script>

</body>
</html>

Related Tutorials