CodesJava

Easy learning with example program codes

Fieldset HTML

HTML <fieldset> Tag

In an HTML form, the logically related fields or labels can be grouped using the HTML <fieldset> tag. It is however not a mandatory tag for creating an HTML form. It is used with the HTML <legend> tag to define a caption for the grouped related fields as a first child.

Syntax:

<fieldset>.....</fieldset>

Example:

<!DOCTYPE html>
<html>
<body>
<form>
 <fieldset>
  <legend>Undergraduate Details:</legend><br>
  Name of University: <input type="text"><br><br>
  Year of Passing: <input type="text"><br><br>
  Aggregate Marks: <input type="text"><br><br> 
  <input type="Submit"> 
 </fieldset>
</form>
</body>
</html>

Output:

Explanation:

In the above example, we have used the HTML <fieldset> tag to group logically related fields of a form.

Tag Specific Attributes:

AttributeValueUses
disableddisabledUsed to determine that a group of related form elements should be disabled.
formform_idUsed to determine one or more forms the fieldset belongs to.
nametextUsed to determine a name for the fieldset.

Global Attributes:

The Global attributes are supported by the HTML <fieldset> tag.

Event Attributes:

The Event attributes are supported by the HTML <fieldset> tag.

Supporting Browsers:

Chrome, IE, Firefox, Opera and Safari.

Please follow and like us:
error
Posted in HTML   









Copyright © 2019 CodesJava DMCA.com Protection Status