<!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. real casino slots gold fish casino slots casino online slots

  2. online slots http://onlinecasinos911.com/# no deposit casino gold fish casino slots big fish casino

  3. http://onlinecasinos911.com/# online casino real casino slots vegas slots online free online slots

  4. http://onlinecasinos911.com/# free casino slot games casino real money casino blackjack

  5. play online casino slots online no deposit casino casino blackjack real casino slots

  6. slots free http://playcasinovivo.com/# slots for real money real casino slots casino bonus codes

  7. online slot games free casino games online online casino gambling

  8. http://playcasinovivo.com/# casino play free online slots casino real money world class casino slots

  9. http://playcasinovivo.com/# online slot games http://playcasinovivo.com/# - online casino slots slot games

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

添加新评论