<!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. slots games free http://onlinecasinogamesww.com/# - casino blackjack casino real money free slots vegas slots online

  2. http://1creditscoreresults.com/# boost my credit score http://getcreditscoreww.com/# - free credit karma equifax credit score

  3. online casinos free online slots online casino vegas slots online

  4. http://casinogamesww.com/# casino bonus codes best online casino online casino gambling casino slots

  5. no deposit casino casino bonus codes vegas casino slots

  6. play slots http://freeonlinecasinoslotsww.com/# - online casino gambling slots games play casino vegas casino slots

  7. big fish casino gold fish casino slots slots for real money casino bonus codes

  8. real casino slots world class casino slots real money casino online casinos

  9. online slots slots for real money play slots free casino games

  10. how to get free credit report credit karma canada free equifax credit report request annual credit report com http://wwcreditreport.com/# - free credit check

添加新评论