unfiled → misc
undecided → low
new → closed
Thanks for taking the time to contribute to the jQuery project by writing a bug report.
This isn't a bug, you just misread what
.index() does when you pass it a selector. The documentation for
.index( selector ) reads:
>selector A selector representing a jQuery collection in which to look for an element.
>If a selector string is passed as an argument, .index() returns an integer indicating the position of the original element relative to the elements matched by the selector. If the element is not found, .index() will return -1.
This says jQuery tells you the position of the first element in the jQuery collection relative to the elements you selector matches.
In your test case this means jQuery checks if
<input type="radio" name="one" value="bar" /> is in the collection matched by
:checked which of course returns -1, as this input isn't checked and thus not in the collection described by your selector.
So what you probably actually want to do is
//what is the index of the checked radio button