<!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://creditreportchecknow.com/# credit score companies http://creditreportuss.com/# - credit report credit bureaus

  2. best online casino http://onlinecasinos911.com/# big fish casino free slots slot games

  3. free annual credit report com http://creditscoresids.com/# annualcreditreport com how to improve my credit score how to unfreeze credit report

  4. online casino vegas casino slots best online casinos casino play

  5. slots games free online slots vegas slots online real money casino online slot games

  6. casino bonus codes slots games free vegas casino slots free casino games online

  7. http://playcasinoww.com/# play slots http://onlinecasinogamesww.com/# - free slots games free slots

  8. free slots games http://casinobonuscodesww.com/# online casino slots gold fish casino slots best online casino

  9. slots for real money free casino games slots online play casino http://casinorealmoneyiw.com/# - casino game

  10. annual credit report completely free whats my credit score turbotax credit report annual credit report completely free http://creditreportgetnow.com/#

添加新评论