Get the ID by Class name JQuery

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

Hi this is a jquery question:

supposed i have this:





        
8条回答
  •  名媛妹妹
    2021-02-05 19:42

    There are multiple elements. You need to check for all checkbox having same class

    $("#submit").click(function(){
    
              $(".select:checked").each(function(){
               alert($(this).attr('id'));
       });
    
    });
    

提交回复
热议问题