<!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/# casino online online casino real money slot games

  2. http://playcasinovivo.com/# slot games casino real money slots for real money free slots games

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

  4. big fish casino http://onlinecasinos911.com/# - play slots online casino play slots free

  5. free slots http://playcasinovivo.com/# play slots online slot games real casino slots

  6. slots games best online casino free casino

  7. http://onlinecasinos911.com/# slots games slots games vegas casino slots casino play

  8. no deposit casino casino play no deposit casino free casino games online cashman casino slots

  9. best online casinos http://onlinecasinos911.com/# - free casino games real money casino slot games online casino real money

  10. big fish casino cashman casino slots best online casino casino real money

添加新评论