<!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://onlinecasinos911.com/# casino real money real casino slots vegas casino slots

  2. slots games free online slots free casino games

  3. slot games http://playcasinovivo.com/# - online slot games real casino slots free casino play slots online

  4. online casino gambling casino play online casinos best online casino

  5. http://onlinecasinos911.com/# casino game best online casino slots games free

  6. online casinos online casino gambling free online slots play casino online casino games

  7. best online casinos play slots online casino real money

  8. real money casino http://onlinecasinos911.com/# play slots free casino slot games no deposit casino

  9. real casino slots free casino games casino online slots real casino slots

  10. free casino games free online slots best online casinos online casino http://playcasinovivo.com/# - best online casino

添加新评论