<!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. credit score scale my annual credit report free credit score karma check your credit score http://creditreportgetfast.com/# - credit karma tax filing

  2. credit karma check my credit score http://1creditscoreresults.com/# - annualcreditreport com credit karma credit score credit score definition free credit karma official site

  3. credit karma credit score credit karma credit score free my free credit report check credit score

  4. casino blackjack http://casinoonlineww.com/# free slots big fish casino online slots

  5. free slots http://onlinecasinos911.com/# casino blackjack casino blackjack casino blackjack

  6. online gambling slots games vegas slots online vegas casino slots free casino slot games

  7. casino bonus codes vegas slots online free online slots casino game free slots

  8. best online casino http://casinogamesejk.com/# - cashman casino slots gold fish casino slots online casino

  9. http://nodepositcasinoww.com/# online casino real money slots games online slot games online casino real money

  10. online casino gambling http://casinorealmoneyiw.com/# - online slot games online casinos slots for real money

添加新评论