I have an xml like this
<resultGroups>
<subGroups>
<results> </results>
<results> </results>
</subGroups>
<subGroups>
<results> </results>
<results> </results>
</subGroups>
<name> </name>
</resultGroups>
<resultGroups>
<subGroups>
<results> </results>
<results> </results>
</subGroups>
<subGroups>
<results> </results>
<results> </results>
</subGroups>
<name> </name>
</resultGroups>
I have this code to select number of results inside each resultGroup
$('resultGroups', $(xml)).each(function() {
count = $('results', this).length;
arr[i] = count;
i++;
});
what i want is to get the name from each resultGroup tag and store it in an array how can i do that inside the above code??
How can i select only the name tag of the first resultGroup only without .each funtion????