Javascript examples for DOM HTML Element:Input Submit
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 |
A String, representing the text displayed on the submit button
The following code shows how to change the text displayed on a Submit button:
<!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>