There are many document attributes that can be used to enhance your web pages.
Some of those attributes are listed below.

  • domain - web domain in which the current web page is stored
  • URL - Universal Resource Locator indicates the page internet location
  • referrer - page from which the current page was linked
  • title - title of current web page
  • lastModified - date and time at which the page was last modified
  • forms - document element that refers to all forms on the current page
  • forms.length - number of forms on the current page
  • images - document element that refers to all images on the current page
  • images.length - number of images on the current page
  • links - document element that refers to all links on the current page
  • links.length - number of links on the current page
  • bgColor - background color of the web page
  • fgColor - foreground or text color of the web page
  • linkColor - color of links on the web page
  • alinkColor - color of active links (mouse down) on the web page
  • vlinkColor - color of visited links on the web page
Below is an example of a Javascript that uses these document attributes to display information about this web page. The results of this Javasript are shown at the bottom of the page. <SCRIPT LANGUAGE="Javascript"> document.write("<FONT COLOR='RED'>"); document.write("<BR>This web page is contained in the domain ", document.domain); document.write("<BR>The full page URL is ", document.URL); document.write("<BR>This paged was linked from ", document.referrer); document.write("<BR>The title of the document is ", document.title); document.write("<BR>This document was last modified on ", document.lastModified); document.write("<BR>This document has ", document.forms.length, " form(s)."); document.write("<BR>This document has ", document.images.length, " image(s)."); document.write("<BR>This document has ", document.links.length, " link(s)."); document.write("<BR>The background color of this document is ", document.bgColor); document.write("<BR>The foreground color of this document is ", document.fgColor); document.write("<BR>The link color for this document is ", document.linkColor); document.write("<BR>The active link color for this document is ", document.alinkColor); document.write("<BR>The visited link color for this document is ", document.vlinkColor); document.write("</FONT>"); </SCRIPT>