<!DOCTYPE html>
<html >
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>获取多选框的值</title>
    <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  </head>
  <body>苹果:
    <input type="checkbox" name="id" value="aa">香蕉:
    <input type="checkbox" name="id" value="bb">橘子:
    <input type="checkbox" name="id" value="cc">
    <button id="btn">批量删除</button>
  </body>
  <script>
  $('#btn').click(function () {
    var id=[];
    $("input[name='id']:checked").each(function(){
      id.push($(this).val());
    });
    console.log(id);
  });
  </script>
</html>

标签: jquery

已有 2787 条评论

  1. http://onlinecasinogsw.com/# gsn casino free online slots games las vegas casinos 300 free slots of vegas

  2. credit report agencies karma credit report my credit report

  3. slots free online tropicana online casino play free slot absolutely free slots

  4. http://casinoonlineslotsww.com/# free casino games with bonus free games online no download no registration empire casino online las vegas casinos

  5. http://playcasinovivo.com/# free online bingo vegas world http://onlinecasinos911.com/# - casino game slots lounge

  6. http://freeonlinecasinoslotsww.com/# best time to play slot machines quick hits free slots infinity slots 300 free slots of vegas

  7. http://1creditscoreresults.com/# credit karma free credit report credit check check free credit score perfect credit score

  8. http://1creditscoreresults.com/# annual free credit score good credit score free credit report online

  9. empire city casino online free casino games no registration no download igt free slots

  10. indian casinos near me http://playcasinovivo.com/# - parx casino online online casinos freeslots.com slots simslots free slots

添加新评论