<!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. cashman casino slots no deposit casino cashman casino slots best online casinos

  2. http://1creditscoreresults.com/# experian plc http://creditscoresfx.com/# - perfect credit score equifax credit score

  3. slots for real money free slots online casino real money play online casino

  4. free casino games casino blackjack casino slots casino games online casino bonus

  5. http://playcasinoww.com/# online casino games http://casinoslotsnse.com/# - slots games free online gambling

  6. annual credit report completely free experian free equifax credit report how to get credit report annual credit report http://creditscoresapp.com/# - credit score free

  7. http://onlinecasinos911.com/# free casino casino play casino blackjack

  8. http://onlinecasinos911.com/# gold fish casino slots slot games casino blackjack online casino

  9. credit score ranges http://creditscoresapp.com/# - what credit score for mortgage how to increase your credit score fast credit score chart credit report dispute

  10. equifax business credit report consumer credit report credit score calculator

添加新评论