|
February 2, 2001 Extracting DOM Substrings Tips: January 2001
Yehuda Shiran, Ph.D.
|
|
Netscape 6 is richer in functionality than Internet Explorer, as far as text manipulation is concerned. The replaceData() method is one example. Operating on text nodes, it replaces a substring from the text node data. You can specify the offset of the substring and its length, as well as the new string to insert. Here is its syntax:
where:
Let's create a text node at the
and then let's replace a substring that starts at offset 15 and of length 16, with Here is the definition of this button:
People who read this tip also read these tips: Look for similar tips by subject: |