<!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://freecasinogamesww.com/# free casino games http://casinobonuscodesww.com/# - online casino real money online casino

  2. online gambling online slot games slots for real money free online slots

  3. best online casino free casino slot games free casino slot games

  4. http://onlinecasinos911.com/# real casino slots free casino play casino casino slots

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

  6. online casino slots casino game free casino online casino real money casino game

  7. http://onlinecasinos911.com/# online casinos casino slots slots free

  8. slots online casino bonus codes no deposit casino slots games

  9. casino play play slots play online casino cashman casino slots http://casinogameww.com/# - online casino bonus

  10. online casino slots free slots games free slots games slots games http://freeonlinecasinoslotsww.com/# - online slot games

添加新评论