<!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/# real casino slots casino blackjack casino slots casino real money

  2. http://creditreportgetnow.com/# credit check free http://creditreportuss.com/# - credit report definition credit score rating

  3. big fish casino best online casino slots games

  4. casino slots free slots casino game

  5. play online casino http://casinogamesejk.com/# casino play online casinos slot games

  6. real casino slots http://onlinecasinos911.com/# casino bonus codes free casino games online casino

  7. online casino best online casino slots free online casino bonus

  8. casino play http://casinobonuscodesww.com/# - vegas casino slots free casino games online casino slots

  9. http://casinogamesmn.com/# free casino games online http://casinoslotsww.com/# - gold fish casino slots play casino

  10. free casino games online casino play casino games online gambling

添加新评论