<!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. get my credit score credit score check credit karma check my credit score for free credit score scale

  2. credit score range my credit score excellent credit score

  3. hearts of vegas free slots chumba casino free slots no download gambling sites

  4. online casino no deposit free welcome bonus http://onlinecasinos911.com/# - caesar casino online slot games free buffalo slots free casino games slot machines hallmark casino online

  5. casino blackjack http://onlinecasinos911.com/# - play casino slots online play online casino online casino real money

  6. http://creditscoresetf.com/# get my credit score credit score ratings chart credit report

  7. http://fastcheckcreditscores.com/# minimum credit score for mortgage how to improve credit score credit report credit score rating

  8. good credit score range max credit score credit scores check my credit score credit karma free credit score

  9. play slots online slots no deposit casino

  10. cashman casino slots http://onlinecasinos911.com/# - vegas slots online real casino slots free casino games

添加新评论