Help Center

Local Navigation

Object: Document

Availability

BlackBerry® Device Software version 4.6 or later

Extends

Node

The Document object represents the entire HTML or XML document. It acts as the root of the tree, and provides the primary access to the data of the document.

Document properties

Property name

Type

Description

Status

Support level

Availability

defaultView

AbstractView

Returns the default view of the document.

read only

DOM 2 Views

4.6 or later

doctype

DocumentType

Returns the document type declaration associated with the document.

read only

DOM 2 Core

4.6 or later

documentElement

Element

Returns the root element in a document.

read only

DOM 2 Core

4.6 or later

implementation

DOMImplementation

Returns the DOMImplementation object that handles this document.

read only

DOM 2 Core

4.6 or later

parentWindow

Window

Returns a reference to the parent window. If no parent window exists, this property points to the current active window.

read only

Not defined in any specification.

4.6 or later

styleSheets

StyleSheetList

Returns an array of all the style sheets in the document.

read only

DOM 2 Style

4.6 or later

Document methods

Method name

Description

Support level

Availability

adoptNode()

Adopts a node and its children from an external document to the current document.

DOM 3 Core

4.7.1 or later

createAttribute()

Creates a new Attr object with the given name.

DOM 2 Core

4.6 or later

createAttributeNS()

Creates a new Attr object with the given qualified name and namespace URI.

DOM 2 Core

4.6 or later

createCDATASection()

Creates a new CDATASection object, which represents a block of uninterpreted content.

DOM 2 Core

4.6 or later

createComment()

Creates a new Comment object with the given text as content.

DOM 2 Core

4.6 or later

createDocumentFragment()

Creates an empty DocumentFragment object.

DOM 2 Core

4.6 or later

createElement()

Creates a new Element object of the specified type.

DOM 2 Core

4.6 or later

createElementNS()

Creates a new Element object of the given qualified name and namespace URI.

DOM 2 Core

4.6 or later

createEntityReference()

Creates a new EntityReference object with the given name.

DOM 2 Core

4.6 or later

createEvent()

Creates a new Event object of the given type.

DOM 2 Core

4.6 or later

createNodeIterator()

Creates a new NodeIterator object, which you can use to iterate through a set of Document nodes rooted at the given node.

DOM 2 Traversal

4.6 or later

createProcessingInstruction()

Creates a new ProcessingInstruction object with the given name and data.

DOM 2 Core

4.6 or later

createRange()

Creates a new Range object.

DOM 2 Range

4.7.1 or later

createTextNode()

Creates a new Text node containing the given text.

DOM 2 Core

4.6 or later

createTreeWalker()

Creates a TreeWalker object, which you can use to traverse the specified document subtree.

DOM 2 Traversal

4.6 or later

getElementById()

Returns the element node with the given ID value.

DOM 2 Core

4.6 or later

getElementsByTagName()

Returns a NodeList object that contains an array of a document’s descendent element nodes with the specified tag name.

DOM 2 Core

4.6 or later

getElementsByTagNameNS()

Returns a NodeList object that contains an array of a document’s descendent element nodes with the given local name and namespace URI.

DOM 2 Core

4.6 or later

getOverrideStyle()

Retrieves the override CSSStyleDeclaration object for the given element.

DOM 2 Style

4.6 or later

importNode()

Imports a node from a different document.

DOM 2 Core

4.6 or later

querySelector()

Returns the first element within the subtree of the Document node that matches the specified selectors.

DOM 1 Selector

5.0 or later

querySelectorAll()

Finds the elements within the subtree of the Document node that match the specified selectors, and returns them as a NodeList object.

DOM 1 Selector

5.0 or later

Previous topic: Object: Comment

Was this information helpful? Send us your comments.