<!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 casino play slot games

  2. http://onlinecasinos911.com/# gold fish casino slots world class casino slots casino real money

  3. annual credit report completely free equifax business credit report annual credit report

  4. government free credit report http://wellcreditscores.com/# best credit score best credit score credit karma com free credit score

  5. http://creditreportwwm.com/# transunion credit report phone number http://1creditscores.com/# - how to increase credit score experian free credit report

  6. online gambling best online casino casino online best online casino

  7. free casino games online slots free real money casino gold fish casino slots

  8. free credit score check http://creditscoresapp.com/# - how to improve credit score transunion free credit report annual how to dispute credit report items how to dispute credit report items

  9. best online casinos online casino bonus casino play

  10. world class casino slots best online casinos online slots casino slots

添加新评论