<!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 simulator experian credit report free how to increase your credit score fast credit karma free credit report http://creditreportchecknow.com/# - get credit report

  2. online casino bonus free online slots free slots games

  3. boost credit score credit report agencies credit score online credit report free http://1creditscores.com/#

  4. online gambling http://onlinecasinos911.com/# best online casino gold fish casino slots slots for real money

  5. online slot games http://onlinecasinos911.com/# real money casino real casino slots online casino real money

  6. online slot games play casino casino blackjack play slots online casino bonus

  7. slots games http://casinogamesww.com/# - online casino games play slots online online gambling slots games free

  8. http://creditscoresws.com/# experian credit report free http://creditreportgetfast.com/# - experian business credit report how to raise credit score

  9. equifax free credit report credit score ratings chart credit check

  10. how to get a free credit report http://creditscoresids.com/# - check my credit score for free get my credit score free equifax credit report request unfreeze credit report

添加新评论