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

Chapter 9. Using the document and body Objects

Chapter 9. Using the document and body Objects


In this chapter, we’ll take a look at the JavaScript properties, methods, and events of the document object and the <BODY> element. In the early days of JavaScript, before each element became a JavaScript object, the document object gave you access to many aspects of what’s really the <BODY> element—for example, the colors used in the web page. And when you’re writing to a web page, you’re really writing to the <BODY> element. Because JavaScript programmers needed access to more than just the <BODY> element, the document object grew—for example, this object also has a title property that gives you access to the <TITLE> element in the <HEAD>,a referrer property that enables you to determine how the user got to the current page, and so on, even a cookie property that lets you set and retrieve cookie data.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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