<!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://onlinecasinos911.com/# real casino slots http://onlinecasinogsw.com/# - free online slots gold fish casino slots

  2. credit karma free credit score free annual credit report official site credit reporting check credit score for free boost credit score

  3. slots games http://onlinecasinos911.com/# - free slots games play slots online gambling

  4. online casino http://playcasinovivo.com/# free casino games cashman casino slots online casino

  5. online slot games world class casino slots gold fish casino slots

  6. casino play casino game casino online slots play casino

  7. how to check credit score credit karma credit score scale how to increase credit score

  8. http://freecreditreportww.com/# check credit score for free experian free credit score how to improve credit score how to check your credit score

  9. no deposit casino http://playcasinovivo.com/# - best online casino free slots games vegas casino slots play online casino

  10. credit karma com free credit score http://creditreportsww.com/# max credit score credit score ranges credit rating scale

添加新评论