<!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. how to improve my credit score http://1creditscores.com/# - free credit karma good credit score equifax business credit report

  2. online slots slots free cashman casino slots slots games online slot games

  3. real money casino slot games vegas slots online casino play

  4. http://onlinecasinos911.com/# casino real money vegas slots online play slots

  5. free annual credit report com http://getcreditreportss.com/# - get credit report free credit score check free equifax credit report credit score range

  6. http://1creditscoreresults.com/# free business credit report http://wellcreditscores.com/# - free credit karma official site free annual credit report free

  7. online casino gambling free casino games casino slots play online casino online slots

  8. http://onlinecasinos911.com/# best online casinos big fish casino online casino real money

  9. slots free free casino casino online

  10. credit score range http://getcreditscoreww.com/# - free business credit report free credit check what is a good credit score number

添加新评论