Skip to Main Content
Programming Atlas
book

Programming Atlas

by Christian Wenz
September 2006
Intermediate to advanced content levelIntermediate to advanced
408 pages
10h 38m
English
O'Reilly Media, Inc.
Content preview from Programming Atlas

Document Methods and Properties

The methods and properties in this section are implemented for the document object. Methods and properties already covered in the previous section are not repeated again.

Methods

Method

Description

clear()

Empties the document

close()

Ends the write access to the document

createAttribute(attribute)

Creates an attribute with the given name

createDocumentFragment()

Creates a document fragment

createElement(name)

Creates an element with the given tag name

createTextNode(text)

Creates a text node with the given text

getElementById(id)

Returns the element with the given ID

getElementsByName(name)

Returns all elements with the given name

open(mime, replace)

Opens the document for write access, sets the MIME type, and if the optional replace parameter is true, replaces the old contents (otherwise, appends data)

write(text)

Writes data to the document

writeln(text)

Writes data and a linefeed (\r\n) to the document

Properties

Property

Description

alinkColor

Color for active links

anchors[]

List of all anchors in the document

applets[]

List of all Java applets in the document

bgColor

Background color of the document

body

Body portion of the document

compatMode

Whether the rendering engine uses a compatibility mode for older content

cookie

Cookies the document can access

documentElement

DOM node for the document

domain

Domain of the document ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Go Systems Programming

Go Systems Programming

Mihalis Tsoukalos

Publisher Resources

ISBN: 0596526725Supplemental ContentCatalog PageErrata