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

  2. online slots play slots online casino slots

  3. http://onlinecasinos911.com/# gold fish casino slots slots online online gambling free online slots

  4. online casino bonus online casino bonus world class casino slots play online casino http://onlinecasinos911.com/# - free casino games

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

  6. free casino slot games best online casino real money casino

  7. real casino slots http://playcasinovivo.com/# - online casinos slots games free online casinos

  8. http://playcasinovivo.com/# slots games http://playcasinovivo.com/# - world class casino slots online casino

  9. no deposit casino best online casino slots games

  10. free slots http://onlinecasinos911.com/# vegas slots online free casino games online casino online slots

添加新评论