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

  1. element testnode = doc.createelement("testnode");

  2. currentnode.appendchild(testnode);

with jquery can insert @ nth position follows:

$("<row>f</row>").insertafter($("parentnode row:nth-child(2)")); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -