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

后端 未结 7 2218
醉话见心
醉话见心 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 07:03

    I don't think you can call

    $.attr('checked',true);
    

    because there is no element selector in the first place. $ must be followed by $('selector_name'). GOod luck!

提交回复
热议问题