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

The <BODY> Element

As discussed in the beginning of this chapter, the document object came along before the <BODY> element, and as a result, many features in the <BODY> element—such as web page colors—are also features in the <BODY> element, although usually with different names.

The <BODY> element didn’t become visible in JavaScript until Internet Explorer 4.0, in fact, and it has a lot to offer scripters. You can access the <BODY> element either by name or ID (with methods such as getElementById), or with the body property of the document object, which holds the body object itself; you use the body object like this: document.body.alink = “cyan”. I’ll take a look at the JavaScript properties, methods, and events of the <BODY> element—represented by the body object in JavaScript—now.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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