<!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://creditscorewww.com/# how to improve credit score max credit score max credit score

  2. online slot games online casino bonus slots games free casino online slots

  3. free credit score report free credit report free credit score karma free credit report

  4. online casinos http://onlinecasinogsw.com/# - casino online slots games free cashman casino slots free casino games

  5. http://onlinecasinos911.com/# free slots casino online free casino games casino play

  6. casino online slots online casino slots online casino bonus free slots

  7. free credit karma check my credit score for free minimum credit score for mortgage how to check your credit score

  8. http://creditreportspa.com/# credit score needed for mortgage check my credit score credit karma credit karma check my credit score

  9. slots games http://onlinecasinos911.com/# - big fish casino slots free online casinos

  10. casino game online slot games vegas casino slots casino online slots http://onlinecasinos911.com/# - slots games

添加新评论