Check first radio button with JQuery

前端 未结 7 1288
春和景丽
春和景丽 2021-01-03 20:22

I would like to check the first radio button of each group. But there are some radio button that are disabled, so the script should ignore them and go to next non-disabled b

相关标签:
7条回答
  • 2021-01-03 21:05

    A little upgrade for 2020. The official documentation suggests the use of "first()" and "prop()"

    $("input[name='groupName'][disabled=false]").first().prop("checked", true);
    
    0 讨论(0)
提交回复
热议问题