Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project









TAG:  legend

<legend> ... </legend>
 
The legend tag is used to create a caption for the form elements associated with a fieldset group. Therefore, this tag can only be used inside the fieldset element. The browser is supposed to render the legend caption in a special manner to accentuate the appearance.
 
This tag is one of three tags implemented in HTML 4.0 that help set the appearance of a form. The other two are fieldset and label.
 
The separate closing tag is mandatory.
 
Attributes and Events
 
class    dir    id    lang    onclick    ondblclick    onkeydown    onkeypress    onkeyup    onmousedown    onmousemove    onmouseout    onmouseover    onmouseup    style    title
 
accesskey
The accesskey attribute allows you to designate a key on the keyboard that when pressed, along with the alt or meta key, will bring focus to the form element associated with the legend.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DevGuru XHTML legend Tag Example</title>
</head>
<body>
<form>
<fieldset>
<legend>Please Enter Your Name</legend>
<label for="firstname">First Name</label><input type="text" id="firstname" />
<br />
<label for="lastname">Last Name</label><input type="text" id="lastname" />
</fieldset>
</form> </body>
</html>

 
Output:
Please Enter Your Name


 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information