In jQuery, how do I get the value of a radio button when they all have the same name?

前端 未结 7 1016
[愿得一人]
[愿得一人] 2020-11-28 04:44

Here is my code:

Sales Promotion
7条回答
  •  孤独总比滥情好
    2020-11-28 04:44

    in your selector, you should also specify that you want the checked radiobutton:

    $(function(){
        $("#submit").click(function(){      
            alert($('input[name=q12_3]:checked').val());
        });
     });
    

提交回复
热议问题