<!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://playcasinovivo.com/# online casinos http://playcasinovivo.com/# - online gambling play slots online

  2. world class casino slots gold fish casino slots free slots slots games http://playcasinovivo.com/# - real casino slots

  3. world class casino slots http://onlinecasinogsw.com/# - play casino play slots online online casino games

  4. online slot games slots games free slots for real money no deposit casino

  5. credit karma home my credit score free credit bureau

  6. vegas casino slots best online casino slots for real money

  7. http://creditreportchk.com/# credit score ratings chart excellent credit score credit reporting

  8. big fish casino http://onlinecasinos911.com/# casino play casino games world class casino slots

  9. http://onlinecasinogsw.com/# online gambling real casino slots slots games gold fish casino slots

  10. casino game http://playcasinovivo.com/# casino real money slots free online gambling

添加新评论