当前位置: 动力学知识库 > 问答 > 编程问答 >

jquery - Store a Javascript variable in next variable statement

问题描述:

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);​
分享给朋友:
您可能感兴趣的文章:
随机阅读: