<!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. vegas slots casino http://casinogamesww.com/# slots games no deposit casinos vegas slots casino

  2. http://casinoonlineslotsww.com/# slots games vegas world http://onlinecasinogamesww.com/# - free casino games sugarhouse online casino

  3. credit karma credit score check my credit score credit report free check credit score free free credit score report

  4. experian free credit score perfect credit score max credit score free annual credit report official site

  5. karma credit score http://1creditscoreresults.com/# my credit score free credit score experian get credit score

  6. slotomania free slots http://onlinecasinogamesww.com/# - free video slots mohegan sun free online slots online slot machines

  7. zone online casino slots free slots vegas world free casino games slot machines free video slots

  8. http://playcasinovivo.com/# online slots real money http://onlinecasinos911.com/# - online slots foxwoods online casino

  9. free games for casino slots hollywood http://playcasinovivo.com/# - las vegas free penny slots big fish casino msn games zone online casino

  10. fortune bay casino http://playcasinovivo.com/# new no deposit casinos accepting us players play free slot machines with bonus spins free online slots no download

添加新评论