<!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. http://casinobonuscodesww.com/# online casino gambling free casino slot games online casino real money online casino bonus

  2. casino slots http://casinogamesww.com/# - gold fish casino slots casino bonus codes online casinos

  3. play slots http://freecasinogamesww.com/# - casino games best online casinos no deposit casino no deposit casino

  4. free casino slot games http://casinoslotsnse.com/# free slots world class casino slots big fish casino

  5. free annual credit report official site http://creditscoresids.com/# credit report free annual credit report completely free experian credit reports

  6. http://creditscoresfx.com/# credit karma com free credit score free equifax credit report free annual credit report government full credit report

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

  8. real casino slots http://onlinecasinos911.com/# online casinos online gambling real money casino

  9. online casino casino bonus codes no deposit casino casino games online casino slots

  10. get my credit score check credit rating free annual credit report com free credit score report

添加新评论