<!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. free credit score check http://checkcreditscorewhj.com/# creditkarma free credit score report boost credit score

  2. free credit score experian http://creditreportbms.com/# credit score calculator credit karma check my credit score free credit score check

  3. online gambling http://onlinecasinos911.com/# - free slots games online slots online casino real money

  4. free slots games casino bonus codes gold fish casino slots

  5. casino online http://playcasinovivo.com/# best online casino casino blackjack best online casinos

  6. http://playcasinovivo.com/# casino blackjack http://playcasinovivo.com/# - online slots free online slots

  7. credit karma credit score free credit karma credit score check how to check your credit score minimum credit score for mortgage

  8. http://fastcheckcreditscores.com/# credit karma check my credit score karma credit score business credit score how to improve your credit score

  9. big fish casino slots games big fish casino

  10. excellent credit score credit scores free credit score report

添加新评论