Here is my code:
var CDs=$(xml).find("CDs");
var NthChild = $(CDs).find("CD:nth-child(index)"); // nth-child 0th element starts at 1
I’m using the find method here; I have to specify the child node name, which is noted as “CD”. Is there are a faster or shorter method, perhaps one that doesn’t need me to specify the name of the child node (i.e. “CD”) to find the nth child node?
Thank you.
UPDATE
I found a format that doesn’t need to specify the child node by name:
var NthChild = $(CDs).children(":nth-child(index)");
According to jQuery docs