<!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. best online casino online casinos 100 free casino no deposit

  2. http://creditscoresws.com/# check credit score average credit score free annual credit report free

  3. credit karma credit score free http://creditscoresapp.com/# credit karma credit score credit score repair how to check credit score for free

  4. free casino games slots http://freeonlinecasinoslotsww.com/# - mohegan sun free online slots play slots for real money united states most popular free casino slots play free casino games online

  5. free casino games slot machines 100 best usa casinos with best codes free slots casino games casino slot free http://casinoonlineslotsww.com/# - las vegas free penny slots

  6. free credit ck http://creditreportchecknow.com/# my free credit score credit report dispute credit karma credit score free

  7. truly free credit scores get free credit report credit score free credit score equifax free annual credit report government

  8. hollywood casino online slots http://onlinecasinogsw.com/# - free casino slots no download free casino slots bonus games no deposit casinos

  9. slots for real money free vegas slots online free slot play no download cashman casino slots http://onlinecasinos911.com/# - play casino

  10. hot shot casino slots cashman casino slots heart of vegas free slots hollywood casino free slot play http://onlinecasinogsw.com/# - pch slots tournament

添加新评论