<!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. real casino slots online casino games best online casinos casino online

  2. online casinos slots games free best online casino play slots online http://onlinecasinos911.com/# - no deposit casino

  3. online casinos http://playcasinovivo.com/# - casino games free online slots slots for real money online casino games

  4. gold fish casino slots http://playcasinovivo.com/# - casino online online casino games big fish casino online casino games

  5. best online casinos online casino gambling online casino real money free online slots no deposit casino

  6. no deposit casino http://onlinecasinos911.com/# online slot games casino online slots games

  7. best online casino http://playcasinovivo.com/# vegas slots online free casino games online online slot games

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

  9. world class casino slots http://playcasinovivo.com/# online casino real money real casino slots casino play

  10. slots games free real casino slots slots free slots games

添加新评论