Text : CharacterData
Return to: HTML DOM Level 3 index

Properties

Property Action Mozilla Safari Chrome Opera
wholeText : DOMString
Returns all text of Text nodes logically-adjacent to this node, concatenated in document order.
Show Details
For the following code (an Element node containing two Text nodes separated by an Entity reference):

bar & foo

The value of wholeText for the Text node containing "bar" is "barfoo". The value of wholeText for the Text node containing "foo" is also "barfoo".
Availability

HTML DOM Level 3|W3C

Returns whether this text node contains element content whitespace, often called "ignorable whitespace". The text node is determined to contain whitespace in element content during the load of the document or if validation occurs while using Document.normalizeDocument().
Show Details
Availability

HTML DOM Level 3|W3C

Functions

Method Action Mozilla Safari Chrome Opera
replaceWholeText(DOMString content) : Text
Replaces the text of the current node and all logically-adjacent text nodes with the specified text. All logically-adjacent text nodes are removed including the current node unless it was the recipient of the replacement text. This method returns the node which received the replacement text. The returned node is: * null, when the replacement text is the empty string; * the current node, except when the current node is read-only; * a new Text node of the same type (Text or CDATASection) as the current node inserted at the location of the replacement.
Show Details

Parameters
DOMString content The content of the replacing Text node.

Returns
Text

For the following code (an Element node containing two Text nodes separated by an Entity reference):

bar & foo

Calling replaceWhole Text on the Text node that contains "bar" with "yo" in argument results in the following:

yo

Availability

HTML DOM Level 3|W3C

text_javascript aptana_docs