C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML
HTML <legend> tagHTML <legend> tag is used to insert a title or caption to its parent element such as <fieldset>. The <legend> element must be the first child of <fieldset > element. By using <legend> tag with <form> elements, it is easy to understand the purpose of grouped form elements. Syntax<legend> Content........<legend> Following are some specifications about the HTML <legend> tag
Example<!DOCTYPE html> <html> <head> <title>Legend Tag</title> </head> <body> <h1>Example of Legend Tag</h1> <form> <fieldset> <legend>Employee basic information:</legend> <label>First Name</label><br> <input type="text" name="fname"><br> <label>Last Name</label><br> <input type="text" name="lname"><br> <label>Enter Email</label><br> <input type="email" name="email"><br><br> <input type="Submit"><br> </fieldset> </form> </body> </html> Output: Attribute:Tag-specific attributes:
Global attribute:The <legend > tag supports the global attributes in HTML Event attribute:The <legend> tag supports the event attributes in HTML. Supporting Browsers
Next TopicHTML lists
|