最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

splitText Method

Internet Development Index

Divides a text node at the specified index.

Syntax

oSplitNode = TextNode.splitText( [iIndex])

Parameters

iIndex Optional. Integer爐hat specifies the index of the string that indicates where the separation occurs. If a value is not provided, a new text node with no value is created.

Return Value

Returns a text node object.

Remarks

The text node that invokes the splitText method has a nodeValue equal to the substring of the value, from 0 to iIndex . The new text node has a nodeValue of the substring of the original value, from the specified index to the value length. Text node integrity is not preserved when the document is saved or persisted.

Example

This example uses the splitText method to divide a text node in half in a ul object. When the text node splits, the createElement method creates a new li object. The appendChild method appends the new li element and the split text node to the ul object.

<SCRIPT>
function fnSplitNode(){
var oNode=oList.firstChild.childNodes(0);
var oNewNode=document.createElement("LI");
var oSplitNode = oNode.splitText(oNode.nodeValue.length/2);
oList.appendChild(oNewNode);
oNewNode.appendChild(oSplitNode);
}
</SCRIPT>
<UL onclick="fnSplitNode()" id="oList">
<LI>This is a list item.
</UL>

Standards Information

This method is defined in World Wide Web Consortium (W3C) Document Object Model (DOM) Level 1 Non-Microsoft link.

Applies To

TextNode

See Also

createElement
柞水县| 焉耆| 赤壁市| 望奎县| 城市| 逊克县| 潜山县| 吴旗县| 北京市| 徐水县| 清徐县| 当雄县| 富平县| 宣武区| 新丰县| 夹江县| 平凉市| 楚雄市| 平果县| 叙永县| 樟树市| 新营市| 旺苍县| 新乐市| 荔波县| 盱眙县| 斗六市| 义乌市| 荥阳市| 哈密市| 醴陵市| 文安县| 淮阳县| 塔河县| 宿迁市| 上高县| 龙山县| 丰顺县| 和平区| 富裕县| 井陉县|