2 answers
A fieldset is used to group related elements in a form. It is useful for creating structures such as tables or grid layouts.
codelikepro
· 19 Aug 2022
Report
Was this answer helpful?
Thanks for the feedback.
Sign up free to save answers and ask your own doubts
The <fieldset> tag groups related controls in a form and draws a box around them; <legend> gives the group a caption.
<form>
<fieldset>
<legend>Personal details</legend>
Name: <input type="text" name="name"><br>
Email: <input type="email" name="email">
</fieldset>
</form>- It makes long forms easier to read and improves accessibility, since screen readers announce the legend with the fields.
- The
disabledattribute on a fieldset disables all controls inside it.
It is meant for grouping form fields, not for making tables or grid layouts (use <table> for tabular data and CSS grid/flexbox for layout).
Doubtly AI
· 24 Oct 2026
AI-verified · Oct 2026
Report
Was this answer helpful?
Thanks for the feedback.
Sign up free to save answers and ask your own doubts
Your answer
Log in or create a free account to answer this question.