i am fetching xml by using ajax/jquery, suppose my xml is
<root>
<parent name="p1">
<child name="c1" value="1"/>
<child name="c2" value="2"/>
</parent>
<parent name="p2">
<child name="c3" value="3"/>
<child name="c4" value="4"/>
</parent>
</root>
now i want to read only values of child of “p2” not “p1” i.e. (3,4),
normal jquery code i.e.
$(result).find("child").each(function(){
value1=$(this).attr("value");
alert(value1);
});
is not working here… it will also return “1” & “2” which i dont want.
can anybody pls tell me, how can i achieve this ?
You can modify your
childselector to be more specific