<!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/# slot games free casino games real casino slots

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

  3. slots games free casino game slots online online casino slots

  4. online casino real money http://onlinecasinos911.com/# casino blackjack play slots cashman casino slots

  5. vegas slots online casino blackjack free casino games

  6. cashman casino slots free casino free casino slot games casino real money

  7. http://playcasinovivo.com/# free slots games slots online online casinos free casino

  8. free casino online casino real money vegas casino slots

  9. online casinos slots games slot games big fish casino

  10. http://onlinecasinos911.com/# big fish casino casino online slots games free

添加新评论