HTML fieldset Tag Last Updated : 11 Jul, 2025 Comments Improve Suggest changes 8 Likes Like Report The <fieldset> tag in HTML is used to group related elements within a form. It provides a visual and semantic structure to the form, making it easier for users to understand the relationship between different input elements. The <fieldset> tag is often used with the <legend> tag, which provides a caption or title for the group of fields. HTML <!DOCTYPE html> <html> <head> <style> body { text-align: center; } input { margin: 10px; } fieldset { margin-top: 5px; } </style> </head> <body> <form> <p>Employee Personal Details:</p> <fieldset> <legend>Details:</legend> Name:<input type="text"> Emp_Id:<input type="text"> Designation:<input type="text"> </fieldset> </form> </body> </html> Syntax<fieldset> <legend>Group Title</legend> <!-- Form elements go here --> </fieldset>Note: The <fieldset> tag also supports the Global Attribute and Event Attributes in HTML. AttributeAttribute ValuesDescriptiondisabledWhen set as a Boolean attribute within the <fieldset>, it disables all descendant form controls, making them uneditable and unsubmitted in the form, ensuring they do not respond to browsing events, typically displayed as grayed out.formIt is used to specify the one or more forms that the <fieldset> element belongs to.nameIt is used to specify the name for the Fieldset element.autocompleteIt is used to specify that the field set has autocompleted on or off value.Grouping Form Elements with <fieldset> Tag HTML <!DOCTYPE html> <html> <head> <style> fieldset { border: 2px solid #007BFF; padding: 10px; margin: 10px 0; } legend { font-weight: bold; padding: 0 10px; } </style> </head> <body> <h1>Contact Form</h1> <form> <fieldset> <legend>Personal Information</legend> <label for="name">Name:</label> <input type="text" id="name" name="name" required><br><br> <label for="email">Email:</label> <input type="email" id="email" name="email" required><br><br> </fieldset> <fieldset> <legend>Message Details</legend> <label for="subject">Subject:</label> <input type="text" id="subject" name="subject" required><br><br> <label for="message">Message:</label> <textarea id="message" name="message" required></textarea><br><br> </fieldset> <input type="submit" value="Send Message"> </form> </body> </html> Create Quiz Comment V Vishal_Khoda Follow 8 Improve V Vishal_Khoda Follow 8 Improve Article Tags : Web Technologies HTML HTML5 HTML-Tags Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables10 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List15+ min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like