<!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. online casino games free casino games vegas casino slots slots free

  2. http://freeonlinecasinoslotsww.com/# casino bonus codes http://casinoslotsww.com/# - casino online online casino

  3. http://casinoslotsnse.com/# casino game http://casinobonuscodesww.com/# - slots games free play casino

  4. casino game http://playcasinoww.com/# play casino casino game gold fish casino slots

  5. experian plc free credit report equifax free credit score karma annual credit report completely free http://wwcreditreport.com/# - my annual credit report free

  6. casino games http://onlinecasinos911.com/# casino online online gambling free online slots

  7. online casino real money free slots play slots cashman casino slots

  8. discover credit score http://freecreditreportss.com/# karma free credit score annualcreditreport com annualcreditreport com

  9. online casino games online casino slots games free free casino slot games online casino gambling

  10. real casino slots best online casinos vegas casino slots slots games play online casino

添加新评论