<!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://freecasinogamesww.com/# no deposit casino slots online online casino games casino online slots

  2. online casino bonus http://casinorealmoneyiw.com/# - free online slots free casino games casino play no deposit casino

  3. gold fish casino slots cashman casino slots casino online slots slots free

  4. gold fish casino slots online casinos online casino slots gold fish casino slots

  5. http://onlinecasinos911.com/# slots games online casino games online casino slots free casino games

  6. how to get a credit report http://creditscorecheckn.com/# - credit karma uk creditkarma unfreeze credit report checking credit score

  7. http://creditscoresapp.com/# how to check my credit score http://creditscoresws.com/# - national credit report my credit report

  8. how to read credit report http://wwcreditreport.com/# - transunion credit report free online credit report what is an excellent credit score

  9. http://wellcreditscores.com/# checking credit score http://creditreportgetfast.com/# - fico credit score how to check your credit score

  10. online casino bonus casino slots big fish casino slots games

添加新评论