<!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. connect to vegas world http://casinogamesww.com/# - online casinos real money online casino hollywood casino free slots online free vegas casino games

  2. slots for real money free no deposit play casino online casino slots free casino games sun moon

  3. http://onlinecasinogsw.com/# fortune bay casino free casino slots no download free blackjack vegas world casinos near my location

  4. 50 lions free slots free slots no download no registration real vegas casino games free free games online slots

  5. best free slots vegas world http://onlinecasinogsw.com/# casino online free casino slots no download 200 free slot games

  6. free casino games vegas world slot machine games free las vegas free slots

  7. what is a perfect credit score credit scores online how to get a credit score

  8. free annual credit report government official annual credit score credit karma free credit report

  9. http://onlinecasinogsw.com/# play casino games for free http://playcasinovivo.com/# - ruby slots free blackjack vegas world

  10. http://onlinecasinogamesww.com/# best online slots http://freeonlinecasinoslotsww.com/# - usa no deposit casino bonus codes slots for real money

添加新评论