XML DOM deleteData() method
Definition and usage
The deleteData() method from Text or Comment Node deletes text.
Syntax:
CharacterData.deleteData(start,length)
Parameter | Description |
---|---|
start | Required. The position of the first character to be deleted. |
length | Required. The number of characters to be deleted. |
throw
This method can throw a DOMException with the following code DOMException exception:
INDEX_SIZE_ERR - Parameter start or length is negative, or length is greater than the length of the Text node or Comment node.
NO_MODIFICATION_ALLOWED_ERR - The node is read-only and cannot be modified.
Description
This method will delete from start characters starting from the specified character are deleted from the Text node or Comment node length characters. If start plus length is greater than the number of characters in a Text node or Comment node, then delete from start All characters from the start to the end of the string.
Related pages
XML DOM reference manual:Text.deleteData()
XML DOM reference manual:Comment.deleteData()