<!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 no download gsn casino slots foxwoods online casino las vegas free penny slots slots lounge

  2. new no deposit casino usa free blackjack games casino style free online casino slots

  3. online casino big fish casino gold fish casino slots

  4. free slots games play casino online casino bonus free casino http://casinoonlineslotsww.com/# - casino online slots

  5. casino real money online casino gambling online casino games

  6. http://casinorealmoneyeyu.com/# no deposit casino slots for real money online slots online casino gambling

  7. http://casinogamesww.com/# slots games best online casinos no deposit casino online slots

  8. free online games that pay real money firekeepers casino show all free slots games free slot games download full version dakota sioux casino

  9. hollywood casino free online games free casino blackjack games no download no registration slots play slots for real money fortune bay casino

  10. caesars free slots online play casino games for cash no deposit games online for real cash big slots games for free slots free

添加新评论