I have the following markup (this is an example there are hundreds)
<div class="Q3"> 1. Suspension & Chassis <span id='q6_p01'>2</span></div>
<input type="radio" name="r6_p01" id="r6_p01_1" value="1"/>
<input type="radio" name="r6_p01" id="r6_p01_2" value="2"/>
<div class="Q3"> 2. Suspension & Chassis <span id='q6_p01'>2</span></div>
And I want to find out how many radio buttons I have from one div to the next.
I have tried:
var selection = $("div.q3:eq(0)").nextUntil('div','input[type="radio"]').length;
And endless variations on that theme, but I always get an answer of 0.
What am I missing? Any help would be greatly appreciated!
Nick
Your class is
Q3but your selector is lowercaseq3. Otherwise your nextUntil should work.