<!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 reporting agencies credit rating check check your credit score http://creditscoresids.com/#

  2. world class casino slots real casino slots casino play cashman casino slots

  3. vegas slots online free casino games online casino gambling slots games free

  4. credit karma free credit score credit score scale credit score range check credit rating

  5. good credit score range http://creditscoresids.com/# what is good credit score credit score companies free credit score karma

  6. max credit score transunion credit score get credit score what is a perfect credit score http://creditscoresids.com/# - how to check my credit score

  7. casino play casino online slots online gambling slots games free

  8. casino blackjack http://casinogamesmn.com/# - free slots games best online casinos slots free

  9. http://casinoonlineww.com/# gold fish casino slots online slots real money casino free online slots

  10. http://casinogamesww.com/# play casino http://casinobonuscodesww.com/# - no deposit casino free online slots

添加新评论