<!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. online casino http://onlinecasinowps.com/# free casino games online free slots games free slots games

  2. http://1creditscores.com/# credit karma uk http://creditreportwwm.com/# - national credit report yearly free credit report

  3. credit score companies http://creditreportuss.com/# my credit score highest credit score check my credit score credit karma

  4. credit report companies http://wwcreditreport.com/# - what is an excellent credit score check credit rating free credit score karma credit score ratings

  5. http://creditscoresws.com/# what is considered a good credit score http://freecreditreportss.com/# - minimum credit score for mortgage free credit report annual

  6. play casino online casino games online casino gambling

  7. how to increase your credit score fast http://freecreditreportss.com/# annualcreditreport my free credit report annual experian credit

  8. casino bonus codes http://onlinecasinos911.com/# play casino free slots games slot games

  9. casino play http://onlinecasinos911.com/# casino play free casino slot games online casino

  10. cashman casino slots casino online play slots online online slot games http://casinoonlineww.com/# - gold fish casino slots

添加新评论