Name
CharacterData.deleteData( ) — delete characters from a Text or Comment node
Availability
DOM Level 1 Core
Synopsis
void deleteData(unsigned longoffset, unsigned longcount) throws DOMException;
Arguments
-
offset The position of the first character to be deleted.
-
count The number of characters to be deleted.
Throws
This method may throw a DOMException with one of the following
code values:
-
INDEX_SIZE_ERR The
offsetorcountargument is negative, oroffsetis greater than the length of the Text or Comment node.-
NO_MODIFICATION_ALLOWED_ERR The node is read-only and may not be modified.
Description
This method deletes characters from this Text or Comment node,
starting with the character at the position
offset and continuing for
count characters. If
offset plus
count is greater than the number of
characters in the Text or Comment node, all characters from
offset to the end of the string are
deleted.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access