Set selected radio from radio group with a value

后端 未结 10 574
深忆病人
深忆病人 2020-12-04 06:04

Why am I struggling with this?

I have a value: 5

How do I check the radio button of group \"mygroup\" with the value of 5?

$(\"input[name=myg         


        
10条回答
  •  北海茫月
    2020-12-04 06:50

    Or you can just write value attribute to it:

    $(':radio[value=]').attr('checked',true);
    

    This works for me.

提交回复
热议问题