<!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 casino slot games free slots online casino bonus casino online http://onlinecasinos911.com/# - no deposit casino

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

  3. big fish casino free casino play slots online free casino slot games

  4. play slots casino slots best online casinos online casinos

  5. online slots http://playcasinovivo.com/# - best online casinos slots online casino blackjack

  6. http://onlinecasinos911.com/# online slots real casino slots free slots games world class casino slots

  7. casino blackjack big fish casino casino bonus codes online casinos

  8. vegas casino slots casino real money free slots free slots http://playcasinovivo.com/# - online casino

  9. online casino real money casino real money world class casino slots

  10. free slots casino slots casino slots play slots

添加新评论