<!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. slot games casino play cashman casino slots best online casino http://onlinecasinos911.com/# - free online slots

  2. real casino slots http://onlinecasinogsw.com/# online casinos online casino bonus cashman casino slots

  3. karma credit score check my credit score for free credit karma credit score ratings chart

  4. credit bureau credit karma free credit score fico credit score credit report

  5. vegas slots online http://playcasinovivo.com/# - vegas casino slots casino game slots games free

  6. real casino slots best online casino play slots online

  7. discover credit score check my credit score credit report credit reporting agencies

  8. casino play no deposit casino online casino no deposit casino http://onlinecasinogsw.com/# - casino blackjack

  9. http://fastcheckcreditscore.com/# credit score range minimum credit score for mortgage highest credit score

  10. credit karma excellent credit score credit score companies karma credit score credit reporting agencies

添加新评论