<!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. play slots online online slot games world class casino slots free slots online gambling

  2. casino online slots http://playcasinovivo.com/# - slot games free casino slot games cashman casino slots

  3. http://onlinecasinos911.com/# free casino http://playcasinovivo.com/# - real casino slots free slots

  4. http://onlinecasinos911.com/# online casino slots online casino no deposit casino online gambling

  5. free casino games http://onlinecasinos911.com/# slots online slots free casino game

  6. casino bonus codes casino bonus codes free slots games

  7. world class casino slots online casino casino games

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

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

  10. free online slots online casino games slots online

添加新评论