<!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 needed for mortgage free credit score equifax check my credit score credit karma free credit score report

  2. experian free credit score credit scores chart credit karma check my credit score

  3. best online casinos http://onlinecasinogsw.com/# online casino bonus slots games free casino games

  4. online casino bonus http://onlinecasinogsw.com/# - play slots online casino real money online casino bonus

  5. casino games online casino bonus free online slots online casino slots

  6. check my credit score credit scores how to increase credit score free credit score equifax highest credit score possible

  7. credit score free credit scores chart business credit score check my credit score

  8. free casino games http://playcasinovivo.com/# world class casino slots slots games free casino play

  9. online casino gambling free casino games online online casinos casino play

  10. karma free credit score credit monitoring get my credit score credit reporting

添加新评论