Get the ID by Class name JQuery

前端 未结 8 1909
臣服心动
臣服心动 2021-02-05 19:00

Hi this is a jquery question:

supposed i have this:





        
8条回答
  •  太阳男子
    2021-02-05 19:39

    you should be using radio buttons and not checkboxes to allow one choice out of many.

    
    
    

    then things will get really simple:

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

提交回复
热议问题