Last Updated : 11 Jul, 2025
The form attribute in HTML <select> specifies the dropdown list's associated form, identified by the id attribute of a <form> element.
Syntax:
<select form="form_id">
Attribute Values:
Name
Description
value
<option> value is sent on form submission, text displays in dropdown.
Example: In this example the <select> element with the form attribute specifying the form it belongs to, allowing course selection.
HTML
<!DOCTYPE html>
<html>
<head>
<title>select Form Attribute</title>
</head>
<body>
<center>
<h2>
HTML <select> form Attribute
</h2>
Select your preferred course from the
drop-down list:
<br />
<select
form="myGeeks"
id="myCourses"
autofocus
>
<option value="C++">c++</option>
<option value="Placement">
Placement
</option>
<option value="Java">Java</option>
<option value="Python">
Python
</option>
</select>
<br /><br />
<form id="myGeeks">
<input type="submit" />
</form>
</center>
</body>
</html>
Output:
HTML form Attribute Example OutputSupported Browsers:
The browser supported by HTML <select>form 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