<!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. slots for real money casino slots best online casinos online casino gambling play online casino

  2. play slots online http://onlinecasinos911.com/# - slots free vegas slots online casino game

  3. casino games slots online online slot games online casino games

  4. online casino games cashman casino slots free casino slot games slot games

  5. slots for real money vegas casino slots slots free

  6. cashman casino slots http://onlinecasinos911.com/# free casino world class casino slots casino game

  7. online casinos free online slots slots games free best online casino slot games

  8. free online slots http://onlinecasinos911.com/# - casino online slots online free casino casino real money

  9. no deposit casino online gambling casino real money

  10. online gambling slots online casino online slots best online casinos big fish casino

添加新评论