Last Updated : 12 Aug, 2022
The HTML <input> form Attribute is used to specify interactive input fields for web-based forms. A form can contain multiple input fields to accept inputs from the users. It is the most powerful element in HTML.
Syntax:
<input form="form_id">
Attribute Value: This attribute contains a single value form_id which contains the value i.e form_id which specify the one or more than the button element belongs to. The value of this attribute should be the id of the <form> element.
Example: This Example illustrates the use of form attribute in <input> element.
html
<!DOCTYPE html>
<html>
<body>
<h1>GeeksforGeeks</h1>
<h2>
HTML <input> form Attribute
</h2>
<form id="myGeeks"></form>
<br />
Name:
<input type="text" id="btn"
name="myGeeks" form="myGeeks"/>
</body>
</html>
Output:
Supported Browsers:
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