HTML legend tag

HTML <legend> tag defines the title or a caption of a form. Html legend element is used as a child of the fieldset element in a form.

<form action="" method="post" >
 <fieldset><legend>Form </legend>
  Name:<input type="text" name="sname"> <br>
  Email:<input type="email" name="email"> <br>
 </fieldset> 
</form>
</>
Form Name:
Email:

Tag Uses

Specific uses of <a> tag

It simply specifies a title or a caption for the html form.

Tag omission

Both opening and closing tags are necessary for legend element.

Global Attributes

All the global attributes support the legend element.



Was this article helpful?

 

Email:

Message: