Javascript examples for DOM HTML Element:Input Submit
The Input Submit object represents an HTML <input> element with type="submit".
You can access an <input> element with type="submit" by using getElementById():
<!DOCTYPE html> <html> <body> <input type="submit" id="mySubmit" value="Submit the form"> <button onclick="myFunction()">get the text displayed on the submit button</button> <p id="demo"></p> <script> function myFunction() {/* w w w .j a va 2s. com*/ var x = document.getElementById("mySubmit").value; document.getElementById("demo").innerHTML = x; } </script> </body> </html>