<!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 equifax credit report http://creditscoresapp.com/# how to dispute credit report items what credit score for mortgage my annual credit report

  2. how to unfreeze credit report http://creditscoresapp.com/# - experian free credit score credit report definition free credit report experian http://getcreditscoreww.com/#

  3. credit score companies anual credit report annual credit report completely free experian credit karma tax filing

  4. free annual credit report complaints credit score rating what is an excellent credit score

  5. play casino real money casino play casino casino blackjack casino games

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

  7. http://onlinecasinos911.com/# free casino slot games online casino vegas slots online slots games free

  8. slots games free http://nodepositcasinoww.com/# casino game slots games free online casino

  9. online casino games slots for real money no deposit casino

  10. play casino http://casinoslotsww.com/# - no deposit casino gold fish casino slots gold fish casino slots

添加新评论