🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Expert Masterclasses.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

HTML Fieldset Tag

Group related form elements together. Learn to use the <fieldset> tag with <legend> for better form organization and accessibility.

fieldset.html
<!-- Fieldset Group -->
<fieldset>
<legend>Contact Info</legend>
<input type="text" name="name">
<input type="email" name="email">
</fieldset>
📋
fieldset.html
1 / 7
📋

Tutor:The <fieldset> tag groups related form elements together. It creates a visual and semantic grouping, making forms more organized and accessible.


Form Grouping Mastery

Unlock nodes by learning form structure and accessibility.

Concept 1: The Fieldset Tag

The <fieldset> tag groups related form elements together. It creates a visual and semantic grouping, making forms more organized and accessible.

System Check

What is the primary purpose of the <fieldset> tag?


Community Holo-Net

Share Form Designs

Created accessible forms with fieldsets? Share your code and best practices.

Enjoying this guide?

Codesyllabus is 100% free and open-source. Support our mission, pay for server infrastructure, and fuel new tutorials by buying us a coffee!

HTML Fieldset Tag

Author

Pascual Vila

Frontend Instructor.

The <fieldset> tag groups related form elements together. It creates a visual and semantic grouping, making forms more organized and accessible.

Form Grouping

The <fieldset> element wraps related form controls (like inputs, selects, textareas) to create a logical group. This helps users understand which fields belong together.

Using with Legend

Always use a <legend> element inside <fieldset> to provide a caption for the group. The legend appears visually at the top of the fieldset border and is announced by screen readers.

Accessibility Benefits

Screen readers announce the legend when users navigate into a fieldset, providing context for the grouped form elements. This makes complex forms much more accessible and easier to navigate.

Best Practices

Use <fieldset> to group logically related form fields. Keep legends concise but descriptive. Use multiple fieldsets to organize large forms into manageable sections. This improves both visual organization and accessibility.

Fieldset Tag Glossary

<fieldset>
HTML element that groups related form elements together. Creates visual and semantic grouping for better organization and accessibility.
<legend>
HTML element that provides a caption for a <fieldset>. Must be the first child of fieldset and is announced by screen readers.
Form Grouping
The practice of organizing related form controls together. <fieldset> provides semantic grouping for accessibility.
Accessibility
Screen readers announce the legend when navigating into a fieldset, providing context for grouped form elements. This makes forms more accessible.
Block Element
An element that creates a new line and takes full width. <fieldset> is a block-level element.