deleteData (W3C DOM Core method)
var sentence = document.createTextNode ("When you're smiling, the whole world smiles with you."); sentence.deleteData(0, 21);
In the example above we create a
Text node with the value
When you're smiling,
the whole world smiles with you., then we use the
deleteData method to remove the first 22 characters
(the characters between index
If we then did this:
second argument is much larger than the total length of the string, so
everything from character offset
15 to the end of the
string will be deleted, and we'd end up with a
node with the
the whole world, that
Delete a string from this character data, between specified offsets.
Internet Explorer 5.5 in HTML doesn't implement this method (it returns undefined).
There are no comments yet.