<!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://creditreportchk.com/# experian credit score credit reporting agencies credit karma check my credit score

  2. http://onlinecasinogsw.com/# play slots online play slots slot games best online casinos

  3. real money casino real casino slots real casino slots casino slots

  4. casino online slots http://onlinecasinogsw.com/# - online casino slots real money casino slot games

  5. http://onlinecasinogsw.com/# real money casino free slots online casino gambling no deposit casino

  6. free casino online casino bonus online casino slots

  7. check credit score for free excellent credit score best credit score my credit score

  8. credit score chart equifax credit score credit score simulator free credit score check

  9. http://creditscorests.com/# max credit score turbotax credit score check credit score for free

  10. http://fastcheckcreditscore.com/# how to raise credit score boost credit score my credit score free

添加新评论