.attr('checked','checked') does not work

后端 未结 7 2224
醉话见心
醉话见心 2020-12-13 06:15

I am trying to check radio. Neither the following works:

[edit]

$(\'selector\').attr(\'checked\',\'checked\');
$(\'selector\').attr(\'checked\',true)         


        
7条回答
  •  难免孤独
    2020-12-13 06:57

    $('.checkbox').prop('checked',true); 
    $('.checkbox').prop('checked',false);
    

    ... works perfectly with jquery1.9.1

提交回复
热议问题