Javascript examples for DOM HTML Element:Input Submit
Input Submit formMethod Property - Change the method for sending form-data:
<!DOCTYPE html> <html> <body> <form target="_blank"> First name: <input type="text" name="fname" value="Mary"><br> Last name: <input type="text" name="lname" value="Bond"><br> <input type="submit" id="mySubmit" formaction="#" formmethod="get" value="Submit"> </form>// w ww. j a va2s . c o m <button onclick="myFunction()">Change formmethod</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("mySubmit").formMethod = "post"; document.getElementById("demo").innerHTML = "The formaction is now 'POST'."; } </script> </body> </html>