HTML DOM Document Object>>

Document Object

The Document object represents the entire HTML document and can be used to access all elements in a page.

IE: Internet Explorer, F: Firefox, N: Netscape, W3C: World Wide Web Consortium (Internet Standard), D: Deprecated.

Document Object Collections

Collection Description IE F N W3C
anchors[] Returns a reference to all Anchor objects in the document 3 1 2 Yes
applets[] Returns a reference to all Applet objects in the document 4 1 3 Yes
attributes[]   - 1 6 No
childNodes[]   5 1 6 No
embeds[] Returns a reference to all embedded objects in the document 4 1 3 No
forms[] Returns a reference to all Form objects in the document 3 1 2 Yes
images[] Returns a reference to all Image objects in the document 4 1 3 Yes
links[] Returns a reference to all Link objects in the document 3 1 2 Yes
plugins[]   - 1 6 No
stylesheets[]   5 1 6 No

Document Object Properties

Property Description IE F N W3C
alinkColor Sets or returns the color of the active links in the document 3 1 2 D
bgColor Sets or returns the background-color of the document 3 1 2 D
body Specifies the beginning and end of the document body 5 1 6 Yes
cookie Sets or returns all cookies associated with the document 3 1 2 Yes
documentElement Returns a reference to the root node of the document 5 1 6 No
domain Returns the document server's domain name 4 1 3 Yes
fgColor Sets or returns the text-color of the document 3 1 2 D
lastModified Returns the date and time the document was last modified 3 1 2 No
linkColor Sets or returns the color of the links in the document 3 1 2 D
referrer Returns the URL of the document that loaded the current document 3 1 2 Yes
title Returns the title of the document 3 1 2 Yes
URL Returns the URL of the current document 4 1 3 Yes
vlinkColor Sets or returns the color of the visited links in the document 3 1 2 D

Document Object Methods

Method Description IE F N W3C
clear() Clears all elements in the document - 1 2 No
close() Closes the output stream and displays the sent data 3 1 2 Yes
createAttribute("name") Creates an attribute with a specified name 6 1 6 No
createElement("tag") Creates an element 5 1 6 Yes
createTextNode("txt") Creates a text string 5 1 6 Yes
focus() Gives the document focus 5 1 6 No
getElementById() Returns a reference to the first object with the specified ID 5 1 6 Yes
getElementsByName() Returns a collection of objects with the specified NAME 5 1 6 Yes
getElementsByTagName("tag") Returns a collection of objects with the specified TAGNAME 5 1 6 No
open() Opens a document for writing 3 1 2 Yes
write() Writes a text string to a document 3 1 2 Yes
writeln("str") Writes a text string followed by a new line character to a document opened by open() 3 1 2 Yes

Document Object Events

Syntax: document.event_name="someJavaScriptCode"

Event Description IE F N W3C
onClick Executes some code when a Click event occurs 5 1 6  
onDblClick Executes some code when a Doubleclick event occurs 5 1 6  
onFocus Executes some code when a Focus event occurs 5 1 6  
onKeyDown Executes some code when a Keydown event occurs 5 1 6  
onKeyPress Executes some code when a Keypress event occurs 5 1 6  
onKeyUp Executes some code when a Keyup event occurs 5 1 6  
onMouseDown Executes some code when a Mousedown event occurs 5 1 6  
onMouseMove Executes some code when a Mousemove event occurs 5 1 6  
onMouseOut Executes some code when a Mouseout event occurs 5 1 6  
onMouseOver Executes some code when a Mouseover event occurs 5 1 6  
onMouseUp Executes some code when a Mouseup event occurs 5 1 6  
onResize Executes some code when a Resize event occurs 5 1 6  

 

<< Back








   



MSN Nick Name



More Resources...





Most Viewed Services:
  1. HTML Tutorial
  2. XHTML Tutorial
  3. CSS Tutorial
  4. Javascript Tutorial
  5. DHTML Tutorial
  6. VB Script
  7. TCP/IP Tutorial
  8. ADO Tutorial
  9. MYSQL Tutorial
  10. ASP Tutorial
  11. AJAX Tutorial
  12. CFML Tutorial
  13. PHP Tutorial
  14. WML Tutorial
  15. FLASH Tutorial
  16. XML Tutorial
  17. RSS Tutorial
  18. SQL Tutorial
  19. HTML Articles
  1. Javascript Articles
  2. PHP Articles
  3. SEO Articles
  4. Web Design Articles
  5. SEO Tips
  6. Web Design Tips
  7. Articles
  8. CSS
  9. CSS Tips
  10. HTML Tips
  11. JAVASCRIPT Tips
  12. MYSQL Tips
  13. PHP Tips
  14. Money
  15. Tutorials
  16. Web Hosting



  • Home
  • Web Directory
  • Top Directoriers
  • Webmaster Directories
  • Contact
  • © Copyright 2006 All Rights Reserved By CodeDcode.Com