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

  2. casino online online gambling play slots online

  3. online casino bonus vegas casino slots cashman casino slots online gambling play slots online

  4. http://wellcreditscores.com/# what is my credit score http://creditreportwwm.com/# - what is my credit score how to get credit report

  5. online casino games casino games casino game online gambling http://casinoslotsww.com/# - online slot games

  6. free slots games play slots best online casinos casino games

  7. free slots games online casinos big fish casino

  8. vegas slots online http://freeonlinecasinoslotsww.com/# - online casino slots play casino gold fish casino slots online casino

  9. real money casino slots free vegas casino slots slot games

  10. play slots online online casino real money online slot games cashman casino slots

添加新评论