xml - Append new child node between existing nodes -
can know how append new child node between existing nodes.i using org.w3c.dom parsing
current:
<parent node> <row>a</row> <row>c</row> <row>d</row> <row>e</row> </parent node>
i want add new node between , c
<parent node> <row>a</row> <row>b</row> <row>c</row> <row>d</row> <row>e</row> </parent node>
i tried appending child under current node getting added @ end
element testnode = doc.createelement("testnode");
currentnode.appendchild(testnode);
with jquery can insert @ nth position follows:
$("<row>f</row>").insertafter($("parentnode row:nth-child(2)"));
Comments
Post a Comment