<!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 casino games online online casino gambling play slots

  2. free casino online slot games vegas slots online

  3. credit score calculator excellent credit score credit rating scale credit karma credit score

  4. http://checkcreditscorewhj.com/# check my credit score for free credit scores chart credit report

  5. free credit score experian how to raise credit score transunion credit score how to increase credit score

  6. free credit score report check my credit score for free credit score ratings chart credit scores

  7. slot games casino real money slots games free real casino slots

  8. slot games free casino slot games cashman casino slots vegas casino slots http://onlinecasinos911.com/# - casino play

  9. online casino slots http://playcasinovivo.com/# free slots online casino bonus play casino

  10. slots for real money http://onlinecasinogsw.com/# - play slots gold fish casino slots slots online

添加新评论