<!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://playcasinovivo.com/# free casino slot games online casino bonus slots for real money online casino games

  2. free slots http://onlinecasinogsw.com/# - casino games online casino slots cashman casino slots

  3. credit score check credit karma credit karma home check my credit score good credit score

  4. http://creditscorewww.com/# credit score rating experian free credit score credit score chart

  5. check my credit score get my credit score transunion credit score get credit score

  6. credit score companies http://checkcreditscorewhj.com/# max credit score credit score free credit score simulator

  7. business credit score free credit score check free credit karma creditkarma

  8. casino real money http://onlinecasinos911.com/# - casino bonus codes free casino games online play casino casino real money

  9. casino blackjack gold fish casino slots no deposit casino

  10. slots online http://playcasinovivo.com/# - casino online slots play online casino slots online

添加新评论