check next not disabled radio button
I have a bunch of radio buttons, and depending on the choices of other radio buttons, some of radio's are 开发者_如何学Godisabled. The problem is that they the disabled ones remain checked. It's hard to explain this and it's not something I can show in code, because it's just a bunch of garbage and experiments.
So anyway, my question is, how do you find the first not disabled radio button in a radio button group (same name)?
Thanks for your help.
$(':radio:not(:disabled):first')
without first it will find all not disabled radios.
You can find all radiobuttons with :radio
You can reduce that result with :not
You can target all disabled elements with :disabled
You can return the first element from the given set with :first
$('input:radio:not(:disabled):first')
If you want to find out which radiobutton is checked, disregarding any disabled ones, you may want to do something like
$('input:radio:checked:not(:disabled)')
精彩评论