Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <form id="myForm" action="http://www.w3schools.com/jsref/demo_form_method.asp" method="get" target="_blank"> First name: <input type="text" name="fname" value="Donald"><br> Last name: <input type="text" name="lname" value="Duck"><br> <input type="submit" value="Submit"> </form> <p>Click the "Try it" button to change the value of the method and action attributes in the form above.</p> <p><b>Note:</b> Click on the "Submit" button before and after you have clicked on the "Try it" button, to see the effect!</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { document.getElementById("myForm").method = "post"; document.getElementById("myForm").action = "demo_form_method_post.html"; document.getElementById("demo").innerHTML = "The value of action and method was changed."; } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_form_method2 by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:32:03 GMT --> </html>
Result:
Try it Yourself - © w3schools.com