<!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 free casino games online casino bonus codes

  2. casino slots http://nodepositcasinoww.com/# online casino slots slots for real money free casino games online

  3. http://casinoonlineslotsww.com/# free casino slot games free slots games no deposit casino play slots

  4. online slots http://playcasinoww.com/# slots free vegas slots online free online slots

  5. gold fish casino slots http://playcasinoww.com/# - play online casino slots for real money casino online slots online

  6. online casino casino game slots free

  7. http://casinoonlineww.com/# cashman casino slots http://freeonlinecasinoslotsww.com/# - casino play casino real money

  8. online casino real money free casino games online play casino free online slots slots free

  9. http://onlinecasinos911.com/# no deposit casino vegas slots online cashman casino slots casino game

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

添加新评论