So, I have radio boxes of the form
<li><input type="radio" name="names" value="blah"><a>Some text (blah)</a></li>
There are 100 plus of these radio buttons.
Now, I have a jQuery filter, from here. The filter works well.
But, I want to set a jQuery statement that will auto select the radio button if it is, amongst the shown, the only one remaining.
The filter uses show()
and hide()
, which I presume means it switches it from display: block to display: none;
My best crack at doing this on my own looks like this, but it's not working:
if($('li').attr({"display":"block"}).size()==1)
{
$('input[cvs_name]:eq(1)').attr('checked', 'checked');
}
How can I do this?