<!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. play slots online play slots casino bonus codes

  2. http://onlinecasinos911.com/# online slot games online gambling casino slots cashman casino slots

  3. play casino http://onlinecasinos911.com/# online gambling casino slots casino game

  4. real casino slots online casino online casino games

  5. play slots casino online casino real money

  6. slots online world class casino slots free slots games

  7. http://onlinecasinos911.com/# online gambling online slot games free casino games free casino slot games

  8. best online casino play slots big fish casino

  9. http://onlinecasinos911.com/# online casino bonus online casinos casino slots play online casino

  10. online casino games online casinos casino online real money casino casino real money

添加新评论