thanks karl... sorry bout the extra post... i will be more patient next time...
On Dec 18, 11:04 pm, Karl Swedberg <k...@englishrules.com> wrote: > Hi, > > The selector is choking on the prev() filter. You can't start > traversing down within the method that is only looking for a previous > sibling. Also, you can simplify things quite a bit by using the > ":checked" selector and the .length property. > > Try this: > > $('a.quiz-next').bind('click', function() { > if ($(this).prev("ol").find("li.correct :checked").length) { > alert(1); > } > }); > > --Karl > > ____________ > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On Dec 18, 2008, at 8:05 PM, sneaks wrote: > > > > > hi i am attempting to make a small quiz and am having a setback... i > > was hoping someone could provide a hint or solution. > > > heres the html: > > <div id="quiz"> > > <ol> > > <li><strong>What is apple in french?</strong> > > <ol> > > <li><input type="radio" name="q1" /> > > Pomme de terre</li> > > <li><input type="radio" name="q1" /> > > Poire</li> > > <li><input type="radio" name="q1" /> > > Appeaux</li> > > <li class="correct"><input type="radio" > > name="q1" /> Pomme</li> > > </ol> > > <a href="#" class="quiz-next">Next</a> > > </li> > > </ol> > > </div> > > > and the jquery: > > > $('a.quiz-next').bind('click', function() { > > if ($(this).prev("ol li.correct > > input[type='radio']").attr('checked') > > =='checked') { > > alert(1); > > } > > });