<!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://playcasinoww.com/# gold fish casino slots http://playcasinoww.com/# - slots games free best online casino

  2. http://onlinecasinos911.com/# casino play casino slots gold fish casino slots

  3. cashman casino slots slots free play casino slots for real money casino blackjack

  4. http://creditscorecheckn.com/# credit score scale credit karma canada my annual credit report credit score ratings chart

  5. credit score calculator http://1creditscoreresults.com/# - credit score ranges credit score scale what is considered a good credit score national credit report

  6. equifax credit score http://1creditscoreresults.com/# - credit score definition credit rating check credit scoring

  7. http://creditreportgetfast.com/# free equifax credit report credit score calculator what is credit score credit score free

  8. credit score ranges http://1creditscoreresults.com/# - credit reporting credit karma credit score how to get a free credit report http://creditreportgetnow.com/#

  9. http://casinogameww.com/# casino online slots casino blackjack free casino slot games

  10. slot games play online casino play casino

添加新评论