XML DOM - Đối tượng văn bản
Đối tượng văn bản
Đối tượng Text đại diện cho nội dung văn bản của một phần tử hoặc thuộc tính.
Thuộc tính đối tượng văn bản
Property | Description |
---|---|
data | Sets or returns the text of the element or attribute |
isElementContentWhitespace | Returns true if the text node contains content whitespace, otherwise it returns false |
length | Returns the length of the text of the element or attribute |
wholeText | Returns all text of text nodes adjacent to this node, concatenated in document order |
Phương thức đối tượng văn bản
Method | Description |
---|---|
appendData() | Appends data to the node |
deleteData() | Deletes data from the node |
insertData() | Inserts data into the node |
replaceData() | Replaces data in the node |
replaceWholeText(text) | Replaces the text of this node and all adjacent text nodes with the specified text |
splitText() | Splits this node into two nodes at the specified offset, and returns the new node that contains the text after the offset |
substringData() | Extracts data from the node |