<!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. free slots games best online casino slots online play casino

  2. http://onlinecasinos911.com/# play slots online online casino online casino slots casino online slots

  3. online slot games http://onlinecasinos911.com/# casino slots casino blackjack cashman casino slots

  4. http://playcasinovivo.com/# best online casino world class casino slots online gambling free casino games

  5. slots games free slots online free slots

  6. play slots online real casino slots slots free casino bonus codes

  7. online gambling free online slots slots for real money casino online http://playcasinovivo.com/# - vegas casino slots

  8. real casino slots http://onlinecasinos911.com/# slots for real money casino bonus codes online casino

  9. real casino slots casino game casino game cashman casino slots http://onlinecasinos911.com/# - play slots

  10. casino slots casino game slots free casino online slots games free

添加新评论