<!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. what credit score for mortgage social credit score annual free credit report

  2. http://getcreditscoreww.com/# credit score ratings chart credit karma credit report agencies free credit score experian

  3. http://creditscoresids.com/# experian free credit report how to raise your credit score fast free credit score karma credit bureau

  4. cashman casino slots http://playcasinoww.com/# slot games no deposit casino casino online

  5. cashman casino slots best online casino no deposit casino

  6. play slots online http://casinorealmoneyiw.com/# online casino slots casino online online gambling

  7. http://onlinecasinos911.com/# real money casino vegas casino slots casino blackjack

  8. real money casino play slots online free slots games free casino http://playcasinoww.com/# - casino bonus codes

  9. slots games slots games free play slots online

  10. average credit score experian credit report free check my credit report equifax credit report http://freecreditreportss.com/# - how to increase your credit score fast

添加新评论