HTML legend tag

<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.

Example

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

Specific uses

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:

Get the newsletter