<!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://casinorealmoneyeyu.com/# online casino gambling best online casinos best online casinos best online casinos

  2. big fish casino online casino games casino slots

  3. slots games free slots for real money slots online online casino bonus

  4. online casino games http://onlinecasinos911.com/# cashman casino slots online casino bonus slots free

  5. free casino slots games free real money casino casino online slots

  6. http://onlinecasinos911.com/# online slots slots free play slots

  7. cashman casino slots http://freecasinogamesww.com/# - slots online casino online slots casino games casino games

  8. casino online slots best online casinos world class casino slots play online casino

  9. vegas slots online online casino games real casino slots no deposit casino

  10. casino bonus codes http://casinogameww.com/# vegas casino slots cashman casino slots casino game

添加新评论