[jQuery] index of an element
Hi
I'm trying to get this working:
jQuery('#accordion input[@type=radio]').click(function(){
var rank = jQuery('#accordion p').index(function(){jQuery(this).parent('p').eq(0)});
});
my markup:
<div id="accordion">
<h2>bla blah</h2>
<input type="radio" name="q1" value="1" />Yes
<input type="radio" name="q1" value="0" />No
when I output 'rank' it keeps giving me -1.
I tried jQuery(this).parent('p') or jQuery(this).parent('p')[0] but no luck.
I dont get it because my debug says that it is a "object HTMLParagraphElement" and if I ask the html() then the content is the right one.
What I am missing ?
thanks
Olivier