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:
<form>
<fieldset>
<legend>Personal Information</legend>
<label for="name">Name</label>
<br>
<input name="name" id="name">
<br>
<label for="dob">Date of Birth<label>
<br>
<input name="dob" id="dob" type="date">
</fieldset>
</form>
#viastudy

0 comments:

Post a Comment