How we can group data in HTML forms?

HTMLWeb DevelopmentFront End Technology

To group related data in HTML forms use the <fieldset> tag. This tag creates a box around the related elements. The <legend> tag is used inside the <fieldset> tag to give a caption to the group.


You can try to run the following code to group data in HTML forms −

Live Demo

<!DOCTYPE html>
            <legend>Student Information:</legend>
            Student Name:<br>
            <input type="text" name="sname">
            Student Subject:<br>
            <input type="text" name="ssubject">
Published on 07-Feb-2018 12:36:35