Get the ID by Class name JQuery

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

Hi this is a jquery question:

supposed i have this:





        
8条回答
  •  遇见更好的自我
    2021-02-05 19:46

    try something like this, you don't need to iterate

            $(document).ready(function () {
                $("#submit").click(function(){
                      if($(".select").is(':checked')){
                          alert($(".select:checked").attr('id'));
                      }
                });
            });
    

提交回复
热议问题