<!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. play slots online http://onlinecasinogsw.com/# - casino online slots casino play casino play

  2. free credit karma free credit karma free annual credit report official site

  3. credit scores free credit karma excellent credit score credit score companies

  4. credit score chart credit monitoring check my credit score for free

  5. how to improve credit score credit rating scale check credit score free free credit score equifax

  6. world class casino slots http://onlinecasinos911.com/# - slots games online casino no deposit casino

  7. http://playcasinovivo.com/# casino online slots slots games online casino gambling casino game

  8. online casino free online slots world class casino slots play online casino

  9. vegas slots online online casino bonus casino online slots online casino

  10. free slots games http://playcasinovivo.com/# best online casinos play slots online play casino

添加新评论