HTML <label> form Attribute
The HTML <label> form Attribute is used to specify the form to which the label belongs, associating it with a specific input element.
Syntax:
<label form="form_id">
Attribute Values:
The form attribute in HTML’s <label> tag specifies the id of the <form> element to which the label belongs.
HTML <label> form Attribute Examples
Example: Here is the basic implementation of HTML <label> form Attribute.
<!DOCTYPE html>
<html>
<head>
<title>
HTML label form Attribute
</title>
</head>
<body style="text-align:center">
<form action="#" method="get" id="GFG_form">
<!-- Starts label tag from here -->
<label for="student">
Student
</label>
<input type="radio"
name="Occupation"
id="student"
value="student">
<br>
<label for="business">
Business
</label>
<input type="radio"
name="Occupation"
id="business"
value="business">
<br>
</form>
<label for="other"
form="GFG_form">
Other
</label>
</body>
</html>
Output:
Supported Browsers
The browser supported by <label> form Attribute are listed below:
Contact Us