Home >> HTML 5 >> legend Tag in HTML 5

legend Tag in HTML 5

The HTML <legend> tag is used to generate a caption for the <fieldset> tag when grouping related items in an HTML form.

Syntax:

<legend>Contents</legend>

For example:-

<!DOCTYPE html>
<html>
<head>
   <title>legend Tag</title>
</head>
<body>
    <form name"fieldset" action="" method="post">
       <fieldset>
         <legend>Personal Detail:</legend>
         <label for="name">Name:</label>
         <input type="text" id="name" name="name">
         <label for="email">Email:</label>
         <input type="email" id="email" name="email">
         <label for="mobile">Mobile No.:</label>
         <input type="text" id="mobile" name="mobile">
         <input type="submit" value="Submit">
      </fieldset>
    </form>
</body>
</html>

Post Your Comment

Next Questions
li Tag
link Tag
ul Tag
video Tag
wbr Tag

Copyright ©2022 coderraj.com. All Rights Reserved.