问题描述:

This question already has an answer here:

  • Jquery:How to use variable as a selector

    1 answer

网友答案:

you can do it like this

   var sub_cat_form1 = $("input[name='subcategory_form_cat_1']:checked").val();    
   $("input[value="+sub_cat_form1 +"]").attr("checked",true);​
相关阅读:
Top