Javascript Reference
Categories: text

javascript text replaceData( )

@March 15, 2008, 1:22 a.m.
replaceData( )Firefox/Netscape/NN 6 IE 5(Mac)/6(Win) Chrome/Safari/DOM 1  

replaceData(startOffset, count, "newText")

  

Replaces text in the current text node with new text. The original content to be removed is signified by the zero-based start position and the number of characters. The string passed as a third parameter goes into the space vacated by the removed text. A bug in IE 5 for Macintosh crops the new text to the length of the removed text.

 
Parameters
 
  • Positive integer specifying the zero-based starting character point for the deletion.
  • Positive integer specifying the number of characters to be deleted.
  • String value of text to be inserted where the remaining text collapses. A reference that evaluates to a string (such as the data property of another text node in the document) copies the referenced value to the append location.
 
Returned Value

None.


Powered by Linode.