chroniclemaster1 — 2011-02-28T15:08:22-05:00 — #1
I'm looping through each counter on my page to modify those sections. When I try to use the syntax recommend in the jQuery API, however, I can't specify the prev function to match only certain criteria. I've tried...
However, the only thing I can get to work is...
var test = thisCounter.prev().prev();
that works now but it's pretty fragile given that the designers are likely to rework these sections from time to time. How can I grab the previous element which MATCHES my criteria?
paul_wilkins — 2011-02-28T19:45:28-05:00 — #2
chroniclemaster1 — 2011-03-01T12:30:26-05:00 — #3
<input name="software1" id="avc" type="radio" value="" />
<label> AVC</label>(<span class="counter">3</span>)
<input name="software1" id="bcl_converter" type="radio" value="" />
<label> BCL Converter</label>(<span class="counter">26</span>)
I'm iterating over all .counter items with an .each() and I'm trying to grab the sibling radio button. I sounds like you can pass a selector into prev(), but I haven't been able to get that to work and don't understand why. I guess .prev().prev() is OK, but it seems klunky to me.
paul_wilkins — 2011-03-01T15:44:44-05:00 — #4
Try using prevAll('input') instead.