<!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://freecasinogamesww.com/# online casino slots http://freecasinogamesww.com/# - online casinos best online casinos

  2. pop slots casino http://playcasinovivo.com/# indian casinos near me penny slots las vegas free penny slots

  3. play casino http://casinogameww.com/# real casino slots online casino slots play casino

  4. play slots slot games play slots gold fish casino slots http://casinobonuscodesww.com/# - play slots

  5. http://freecasinogamesww.com/# world class casino slots http://playcasinoww.com/# - online casino gambling vegas slots online

  6. casinos near me online casino reviews best place to gamble in vegas gossip slots

  7. http://onlinecasinos911.com/# all slots casino online casino bonus vegas world casino games all casino games free download

  8. free slots online http://casinogamesmv.com/# hollywood online casino play slots for real money hallmark casino online

  9. play free blackjack against computer play free lucky 777 slots caesars slots

  10. slots for real money http://onlinecasinos911.com/# igt free slots free casino blackjack games new online casinos accepting usa

添加新评论