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

  2. free slots games casino slots real money casino slot games

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

  4. casino online online slots gold fish casino slots

  5. play slots play casino casino online slot games

  6. free slots free slots play casino

  7. online slot games http://onlinecasinos911.com/# vegas casino slots online slot games slots online

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

  9. http://onlinecasinos911.com/# slots online http://onlinecasinos911.com/# - casino real money casino play

  10. casino blackjack slots for real money casino online online casino games

添加新评论