What is the use of the HTML tag "legend"?

What does <legend> HTML Tag do?
The <legend> element is used to add a caption to a group of related form <input> elements that have been grouped together into a <fieldset>.
Code Example:
<legend>Personal Information</legend>
<label for="name">Name</label>
<input name="name" id="name">
<label for="dob">Date of Birth<label>
<input name="dob" id="dob" type="date">


Post a Comment