<!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/# vegas casino slots online gambling free casino online casinos

  2. http://onlinecasinos911.com/# vegas slots online slots for real money online casino games online slots

  3. best online casino gold fish casino slots no deposit casino free slots

  4. casino game http://playcasinovivo.com/# big fish casino play slots casino online

  5. casino slots online slot games free slots games online gambling

  6. casino bonus codes http://onlinecasinos911.com/# vegas casino slots slots games free online casino slots

  7. slots online http://onlinecasinos911.com/# - slots games free free casino casino games slots free

  8. slots online no deposit casino slots free

  9. big fish casino real casino slots real casino slots online slots

  10. no deposit casino http://playcasinovivo.com/# - online casino games free slots games slots free play slots online

添加新评论