w3pop.com :: 网络学院 :: XML DOM :: DOM Text
The Text object represents the textual content of an element or attribute.
文本对象代表了一个元素或属性的文本内容。
IE: Internet Explorer, F: Firefox[火狐], O: Opera, W3C: World Wide Web Consortium (Internet Standard) | 万维网联盟(国际标准)
| Property 属性 |
Description 描述 |
IE | F | O | W3C |
|---|---|---|---|---|---|
| data | Sets or returns the text of the element or attribute 设置或返回一个元素或属性的文本 |
6 | 1 | 9 | Yes |
| isElementContentWhitespace | Returns true if the text node contains content whitespace, otherwise it returns false 如果文本节点包含内容空行,则返回true;否则返回false |
No | No | No | Yes |
| length | Returns the length of the text of the element or attribute 以字符的形式返回一个节点的文本长度 |
6 | 1 | 9 | Yes |
| wholeText | Returns all text of text nodes adjacent to this node, concatenated in document order 返回所有与当前节点相邻的文本节点,并按照文档中的顺序连接 |
No | No | No | Yes |
| Method 方法 |
Description 描述 |
IE | F | O | W3C |
|---|---|---|---|---|---|
| appendData() | Appends data to the node 在一个文本节点的末尾添加一个字符串 |
6 | 1 | 9 | Yes |
| deleteData() | Deletes data from the node 删除一个文本节点中的数据 |
6 | 1 | 9 | Yes |
| insertData() | Inserts data into the node 将数据插入文本节点中 |
6 | 1 | 9 | Yes |
| replaceData() | Replaces data in the node 替换文本节点中的数据 |
6 | 1 | 9 | Yes |
| replaceWholeText(text) | Replaces the text of this node and all adjacent text nodes with the specified text 使用指定的文本来替换此节点以及所有相邻的文本节点 |
No | No | No | Yes |
| splitText() | Splits this node into two nodes at the specified offset, and returns the new node that contains the text after the offset 在指定的偏移处将此节点拆分为两个节点,同时返回包含偏移处之后的文本的新节点。 |
6 | 1 | 9 | Yes |
| substringData() | Extracts data from the node 将获取文本节点中的数据 |
6 | 1 | 9 | Yes |
评论 (0)
All