<!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://wellcreditscores.com/# how to check my credit score credit score simulator experian credit report free credit report online

  2. no deposit casino http://freecasinogamesww.com/# - real casino slots slots free online casino

  3. free casino best online casinos casino games slots free

  4. http://onlinecasinos911.com/# slots games free vegas casino slots vegas slots online slot games

  5. slots games free http://freeonlinecasinoslotsww.com/# - online casino real money cashman casino slots online casino real money

  6. real casino slots play slots free casino online casino gambling casino online slots

  7. online casino games play casino vegas casino slots slot games

  8. cashman casino slots http://casinoonlineww.com/# - online slot games slots online slot games

  9. play online casino online slot games real casino slots slots games free

  10. online casino slots play slots casino bonus codes vegas slots online

添加新评论