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

  2. play casino casino blackjack free slots games online casino real money http://casinoslotsww.com/# - casino slots

  3. online casino games http://casinobonuscodesww.com/# gold fish casino slots play casino slot games

  4. http://onlinecasinos911.com/# online slots online casino real money free casino slot games

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

  6. free slots online casino play slots casino real money

  7. casino online play casino casino online casino online slots online casino gambling

  8. online casino http://onlinecasinos911.com/# world class casino slots slots games free slots free

  9. best online casinos online casino slots slots online play casino http://casinorealmoneyeyu.com/# - casino games

  10. slot games http://onlinecasinowps.com/# - cashman casino slots casino slots slots games free online gambling

添加新评论