
Document
70
|
JavaScript Pocket Reference
open()
Deletes existing document content and opens a stream to
which new document contents may be written. Returns
nothing. JS 1.0.
write(value, ...)
Inserts the specified string or strings into the document
currently being parsed or appends to document opened with
open(). Returns nothing. JS 1.0.
writeln(value, ...)
Identical to write(), except that it appends a newline char-
acter to the output. Returns nothing. JS 1.0
W3C DOM Methods
In DOM-compliant browsers, the Document object inherits the
methods of Node, and defines the following additional methods.
createAttribute(name)
Returns a newly-created Attr node with the specified name.
createComment(text)
Creates and returns a new Comment node containing the
specified text.
createDocumentFragment()
Creates and returns an empty DocumentFragment node.
createElement(tagName)
Creates and returns a new Element node with the specified
tag name.
createTextNode(text)
Creates and returns a new Text node that contains the speci-
fied
text.
getElementById(id)
Returns the Element of this document that has the specified
value for its
id attribute, or null if no such Element exists in
the document.
getElementsByName(name)
Returns an array of nodes of all elements in the document
that have a specified value for their
name attribute. If no such
elements are found, returns a zero-length array.