<html>
<body>
<form id="frm1" 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><br>
<input type="submit" value="Submit">
</form>
<p>Click "Try it" to display the value of the form method.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = document.getElementById("frm1").method;
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_form_method by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:40:21 GMT -->
</html>