<!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 blackjack http://onlinecasinos911.com/# slot games online casino slots cashman casino slots

  2. real money casino online casino free casino slot games slots for real money http://playcasinovivo.com/# - no deposit casino

  3. free slots online slot games online slot games vegas slots online

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

  5. world class casino slots slot games online casino bonus slots online

  6. http://playcasinovivo.com/# casino blackjack http://onlinecasinos911.com/# - casino blackjack free casino slot games

  7. no deposit casino play online casino online casino real money

  8. play slots online gold fish casino slots free casino games casino games

  9. casino games play slots online casino slot games

  10. http://onlinecasinos911.com/# play casino world class casino slots free casino games free casino games

添加新评论