<!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. 888 casino online casino games no download no registration vegas world real casino free casino games no download

  2. doubledown casino play free slot machines with bonus spins free casino slots bonus games penny slots for free online big fish free slots games

  3. slots for free play casino games for cash free online slots games

  4. online casino slots http://onlinecasinouse.com/# world class casino slots slots games free online casino slots

  5. play casino http://onlinecasinouse.com/# casino slots free casino games gold fish casino slots

添加新评论