<!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. no deposit casino casino slots online casino gambling free casino games real casino slots

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

  3. http://onlinecasinos911.com/# big fish casino free slots games slots for real money online gambling

  4. slots games free online casino games casino online slots slots free

  5. casino online slots http://onlinecasinos911.com/# slots for real money best online casinos world class casino slots

  6. online casinos http://playcasinovivo.com/# - casino real money slots online slots free

  7. online casino slots http://playcasinovivo.com/# - play slots play slots casino play

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

  9. casino slots slots free slot games slot games slot games

  10. http://playcasinovivo.com/# online casino real money online slot games casino blackjack online casino bonus

添加新评论