• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Working with Forms, Buttons,... > The <FIELDSET> and <LEGEND> Elements

The <FIELDSET> and <LEGEND> Elements

The <FIELDSET> and <LEGEND> elements enable you to format the appearance of elements in a form, and because you use them with forms, I’ll discuss them in this chapter. The <FIELDSET> element draws a rectangle around the form, and a <LEGEND> element nested in that <FIELDSET> element enables you to give the <FIELDSET> element a caption, or legend. You can see the properties of these elements in Table 12.13—note that the properties, methods, and events we saw in Chapters 5 and 6 also apply to these elements. Table 12.14 lists the additional events of <LEGEND> elements.

Table 12.13. The Properties of the <FIELDSET> and <LEGEND> Elements (See Chapters 5 and 6 for the JavaScript core HTML properties, methods, and events that also apply to this element.)
Property NS2 NS3 NS4 NS6 IE3a IE3b IE4 IE5 IE5.5 IE6
align    x    x x x
  Read/write
  This attribute sets the alignment of the <FIELDSET> and <LEGEND> elements. The possible values for the <LEGEND> element are "bottom" (aligns to bottom-center), "center" (aligns to center), "left" (aligns to left), "right" (aligns to right), and "top" (aligns top-center). The Internet Explorer gives you more possible values for the <FIELDSET> element; here they are: "absbottom" (aligns the bottom of the <FIELDSET> with the absolute bottom of the surrounding text), "absmiddle" (aligns the middle of the <FIELDSET> with the middle of the surrounding text), "baseline" (aligns the bottom of the <FIELDSET> with the baseline of the surrounding text), "bottom" (aligns the bottom of the <FIELDSET> with the bottom of the surrounding text), "left" (the default, aligns the <FIELDSET> to the left of the surrounding text), "middle" (aligns the middle of the <FIELDSET> with the surrounding text), "right" (aligns the <FIELDSET> to the right of the surrounding text), and "top" (aligns the top of the <FIELDSET> with the top of the text).
form    x      x
  Read-only
  Holds the form object for the <FIELDSET> or <LEGEND> element. This property is read-only.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint