ZVON > References > DOM2 Reference

deleteData (method )

Owning interface and usage:  
CharacterData.deleteData(offset, count)

Member of these other interfaces:  
CDATASection, Comment, Text

Description:  
Remove a range of 16-bit units from the node.

Parameters:  
unsigned offset  -  The offset from which to removing.
unsigned count  -  The number of 16-bit units to delete. If the sum of offset and count exceeds length then all 16-bit units from offset to the end of the data are deleted.

Returns:  
nothing

Exceptions:  
DOMException INDEX_SIZE_ERR
Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
DOMException NO_MODIFICATION_ALLOWED_ERR
Raised if this node is readonly.

Note:  
Upon success, data and length reflect the change.


Example:
JavaScript:
  var txt = document.createTextNode('AAA-BBB');
  txt.deleteData(0, 4);
  var output = txt.data;
Output:
desired your browser
BBB