<!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 casino free online slots casino bonus codes

  2. vegas slots online http://onlinecasinos911.com/# big fish casino casino slots online slot games

  3. vegas slots online no deposit casino free casino slot games free online slots

  4. vegas casino slots slots games cashman casino slots casino game online slot games

  5. http://casinoslotsww.com/# play casino http://freeonlinecasinoslotsww.com/# - vegas casino slots free online slots

  6. play online casino http://casinoslotsww.com/# - cashman casino slots play casino casino play free casino games

  7. free online slots http://onlinecasinowps.com/# - best online casinos casino game online casino

  8. online casino games casino online vegas slots online online casino bonus slots for real money

  9. http://onlinecasinos911.com/# slots free real casino slots online casino bonus

  10. slots games http://bestcasinoww.com/# - casino game casino online casino games

添加新评论