XML DOM - Text object

## XML DOM Tutorial

DOM HOME DOM Introduction DOM Nodes DOM Node Tree DOM Parser DOM Load Function DOM Methods DOM Accessing DOM Node Info DOM Node List DOM Traversing DOM Browsers DOM Navigating

## Manipulate Nodes

DOM Get Values DOM Change Nodes DOM Remove Nodes DOM Replace Nodes DOM Create Nodes DOM Add Nodes DOM Clone Nodes DOM XMLHttpRequest

## XML DOM Reference

DOM Node Types DOM Node DOM NodeList DOM NamedNodeMap DOM Document DOM DocumentImpl DOM DocumentType DOM ProcessingInstr DOM Element DOM Attribute DOM Text DOM CDATA DOM Comment DOM XMLHttpRequest DOM ParseError Obj DOM Parser Errors
DOM Summary

## XML DOM Examples

DOM Examples DOM Validator

# XML DOM - The Text Object

« Previous
Next Chapter »

## The Text object

The Text object represents the textual content of an element or attribute.

## Text Object Properties

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

## Text Object Methods

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

« Previous
Next Chapter »

## Your suggestion:

Your E-mail (optional):

Page address:

Description:

Close [X]

## Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

## WEB HOSTING

Best Web Hosting UK Reseller Hosting Wow! $5 SSD Hosting

## WEB BUILDING

Download XML Editor
FREE Website BUILDER FREE Website Creator

## WEB RESOURCES

Web Statistics Web Validation

## SHARE THIS PAGE