JavaScript Reference/Javascript Methods/splitText
"splitText()" Example
<source lang="javascript">
<html> <body> <script language="JavaScript"> function function1() {
var myNode = document.all.myParagraph.childNodes(0); var myNew = myNode.splitText(5); alert(myNew.nodeValue);
} </script>
This is some sample text
<input type="button" value="Click here to split" onClick="function1();"> </body> </html>
</source>
"splitText()" is applied to
<source lang="javascript">
+----------------+--------------------------------------------------------------+ | Applied_To |TextNode | +----------------+--------------------------------------------------------------+
</source>
"splitText()" Syntax, Parameters and Note
<source lang="javascript">
Note: Splits a text node at a specified point.
Syntax:
textNodeName.splitText(param1) Parameters:
param1 Optional; the character number at which to split the node. </source>