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

  2. gold fish casino slots http://playcasinovivo.com/# - play online casino free slots games real money casino

  3. big fish casino http://onlinecasinos911.com/# - free online slots online slot games online slot games online casino

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

  5. best online casinos slot games play slots casino online slots http://playcasinovivo.com/# - world class casino slots

  6. online casino real money online slots online casino bonus online casinos

  7. world class casino slots casino bonus codes no deposit casino slots online

  8. online gambling http://onlinecasinos911.com/# - play casino online slot games play slots online

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

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

添加新评论