Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML DOM deleteData() Method

XML DOM deleteData() Method


Text Object Reference Text Object


Definition and Usage

The deleteData() method deletes data from a text node.

Syntax

deleteData(start,length)

Parameters Description
start Required. Specifies where to start deleting data. The starting value begins at 0.
length Required. Specifies how many characters to delete.

Example

The following code snippet uses loadXMLDoc() to load "books.xml" Load into xmlDoc, and from the first some characters from the text node of an element: </p>

Example

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.getElementsByTagName("title")[0].childNodes[0];

x.deleteData(0,9);

document.write(x.data);

Output:

Italian

Try it »


Text Object Reference Text Object