<!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. online casino http://playcasinovivo.com/# free slots games online slots online casinos

  2. http://playcasinovivo.com/# world class casino slots gold fish casino slots free online slots free casino slot games

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

  4. online gambling vegas slots online real money casino casino slots

  5. casino slots slots games free real money casino best online casinos

  6. http://onlinecasinos911.com/# casino bonus codes free casino slot games gold fish casino slots online gambling

  7. online casino slots online casinos free slots games

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

  9. http://onlinecasinos911.com/# slots for real money online slots slots free online slots

  10. http://onlinecasinos911.com/# online casino free casino games online slots best online casinos

添加新评论