Last Updated : 12 Aug, 2022
The HTML <input> formmethod Attribute is used to specify the HTTP method for sending form-data to the action URL. This attribute is used to override the method attribute of the <form> element.
Syntax:
<input formmethod="get | post">
Attribute Values:
Example:
html
<!DOCTYPE html>
<html>
<head>
<title>
HTML input formmethod Attribute
</title>
</head>
<body style="text-align:center;">
<h1 style="color:green;">
GeeksforGeeks
</h1>
<h3>HTML <input>
formmethod Attribute</h3>
<form action="#"
id="users"
action="#"
method="GET"
target="_blank">
First name:
<input type="text"
name="fname"
placeholder="Enter first name">
<br>
<br> Last name:
<input type="text"
name="lname"
placeholder="Enter last name">
<br>
<br>
<input type="submit"
value="Submit"
formmethod="post">
</form>
</body>
</html>
Output:
Supported Browsers: The browsers supported by HTML input formmethod Attribute are listed below:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4