<!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. best online casino http://casinobonuscodesww.com/# - play online casino casino blackjack free casino games

  2. http://casinoslotsww.com/# slots for real money online casino gambling online casino slots free

  3. real money casino casino online slots slots free online gambling

  4. best online casinos cashman casino slots slots games free cashman casino slots

  5. online casino gambling real casino slots best online casinos free casino games

  6. free casino slot games play slots online slots real casino slots

  7. http://onlinecasinos911.com/# vegas slots online online slots free slots

  8. world class casino slots casino real money casino online

  9. free credit karma official site http://creditreportwwm.com/# - credit karma free credit report highest credit score my credit report

  10. get a free credit report credit rating scale my annual credit report

添加新评论