<!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://creditscoresetf.com/# how to improve credit score credit sesame get credit score

  2. world class casino slots big fish casino casino games big fish casino

  3. credit bureau credit sesame average credit score credit score rating

  4. free credit score experian best credit score minimum credit score for mortgage karma credit score

  5. vegas slots online real casino slots online slots slots online

  6. free casino http://onlinecasinos911.com/# - online casino slots gold fish casino slots online casino casino play

  7. casino bonus codes casino games online slot games play slots online http://playcasinovivo.com/# - casino bonus codes

  8. karma free credit score experian free credit score credit score free free credit score equifax

  9. equifax credit score http://creditreportbms.com/# credit report transunion credit score credit score needed for mortgage

  10. credit karma free credit score discover credit score turbotax credit score free credit karma

添加新评论