Search w3schools.com:

SHARE THIS PAGE

HTML DOM Document Object


Document Object

Each HTML document loaded into a browser window becomes a Document object.

The Document object provides access to all HTML elements in a page, from within a script.

Tip: The Document object is also part of the Window object, and can be accessed through the window.document property.

Note: The Document object can also use the properties and methods of the Node object.


W3C: W3C Standard.

Document Object Properties

Property Description W3C
anchors Returns a collection of all the anchors in the document Yes
applets Returns a collection of all the applets in the document Yes
body Returns the body element of the document Yes
cookie Returns all name/value pairs of cookies in the document Yes
documentMode Returns the mode used by the browser to render the document No
domain Returns the domain name of the server that loaded the document Yes
forms Returns a collection of all the forms in the document Yes
images Returns a collection of all the images in the document Yes
lastModified Returns the date and time the document was last modified No
links Returns a collection of all the links in the document Yes
readyState Returns the (loading) status of the document No
referrer Returns the URL of the document that loaded the current document Yes
title Sets or returns the title of the document Yes
URL Returns the full URL of the document Yes

Document Object Methods

Method Description W3C
close() Closes the output stream previously opened with document.open() Yes
getElementsByName() Accesses all elements with a specified name Yes
open() Opens an output stream to collect the output from document.write() or document.writeln() Yes
write() Writes HTML expressions or JavaScript code to a document Yes
writeln() Same as write(), but adds a newline character after each statement Yes



W3Schools Certification

W3Schools' Online Certification

The perfect solution for professionals who need to balance work, family, and career building.

More than 10 000 certificates already issued!

Get Your Certificate »

The HTML Certificate documents your knowledge of HTML.

The HTML5 Certificate documents your knowledge of advanced HTML5.

The CSS Certificate documents your knowledge of advanced CSS.

The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.

The jQuery Certificate documents your knowledge of jQuery.

The XML Certificate documents your knowledge of XML, XML DOM and XSLT.

The ASP Certificate documents your knowledge of ASP, SQL, and ADO.

The PHP Certificate documents your knowledge of PHP and SQL (MySQL).

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]