Properties and methods of text objects
Each contiguous block of text in an HTML document (for example, the text within a P
tag) is represented by a JavaScript object. Text objects never have children. The following table describes the properties and methods of text objects that are taken from DOM Level 1 and used in Adobe Dreamweaver. A bullet () marks read-only properties.
Property or method | Return value |
---|---|
nodeType |
|
parentNode | The parent tag |
childNodes | An empty |
data | The actual text string. Entities in the text are represented as a single character (for example, the text |
hasChildNodes() | false |