How to check a radio button with jQuery?

前端 未结 30 2631
独厮守ぢ
独厮守ぢ 2020-11-22 08:12

I try to check a radio button with jQuery. Here\'s my code:

30条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 08:50

    Some times above solutions do not work, then you can try below:

    jQuery.uniform.update(jQuery("#yourElementID").attr('checked',true));
    jQuery.uniform.update(jQuery("#yourElementID").attr('checked',false));
    

    Another way you can try is:

    jQuery("input:radio[name=yourElementName]:nth(0)").attr('checked',true);
    

提交回复
热议问题