<html>
<body>
<form id="myForm" action="https://www.w3schools.com/action_page.php" method="get">
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 return the value of the method attribute in the form above.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("myForm").method;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_form_method by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:17:12 GMT -->
</html>