Platform Support
| IE | Mozilla | Netscape | Opera | Safari | 5.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ |
|---|
Constructors
| Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | ||
|---|---|---|---|---|---|---|---|---|
|
Text Constructor() : Text
Represents a text node in a document.
|
Show Details | 5.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | ||
Text() : TextRepresents a text node in a document. Returns
|
||||||||
Functions
| Method | Action | IE | Mozilla | Netscape | Opera | Safari | |||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
static splitText(Number offset) : Text
Splits this node into two adjacent nodes at the given offset
|
Show Details | 6.0+ | 1.0+ | 6.0+ | 7.0+ | 1.0+ | |||||
|
Parameters
Returns
|
|||||||||||
Remarks
This object interface represents the text contents, or character data, of an Element or
Attr object.
If an Element only has text and no other elements as its children,
then there will be a single Text node representing all this content. Assuming there are other elements
as it's children however, there will be multiple Text nodes separating the Element
objects from each other. It is also possible for multiple Text nodes to be adjacent to one another,
though when the document is saved (or when the parent Node's Text nodes will be merged into one.
References
Availability
HTML DOM Level 1|HTML DOM Level 2|W3C
