<!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. play free casino slots now http://freeonlinecasinoslotsww.com/# - hearts of vegas free slots online casino bonus big fish casino download free http://casinogamesww.com/#

  2. http://onlinecasinogsw.com/# slots free slots games online casinos totally free casino games

  3. casino online slots http://onlinecasinogsw.com/# - free slots slotomania online slots totally free slots no download

  4. credit karma home credit report free credit score calculator

  5. credit sesame credit sesame check credit score free check my credit score for free

  6. las vegas casinos free vegas casino games indian casinos near me

  7. penny slots free online vegas world free games old version vegas world hollywood casino free slots online http://freeonlinecasinoslotsww.com/# - gsn casino

  8. credit score ratings chart http://creditreportchecknow.com/# free credit score karma karma free credit score my credit score

  9. excellent credit score http://creditscoresws.com/# discover credit score free annual credit report official site free credit report

  10. slots free spins no registration goldfish casino slots free vegas slots online

添加新评论