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

  2. http://onlinecasinos911.com/# slots free play online casino free slots

  3. vegas slots online free slots games casino slots

  4. http://freecreditreportss.com/# get my credit report http://creditreportchecknow.com/# - whats my credit score freecreditreport

  5. equifax credit report free annual http://freecreditreportss.com/# what is a perfect credit score credit score simulator credit karma com free credit score

  6. annualcreditreport com official website free credit check karma credit score unfreeze credit report

  7. casino bonus codes http://casinorealmoneyeyu.com/# casino real money no deposit casino big fish casino

  8. http://playcasinoww.com/# no deposit casino casino slots online casino games free slots

  9. slot games slots free real money casino play casino

  10. http://casinorealmoneyiw.com/# cashman casino slots http://casinoonlineslotsww.com/# - casino online slots best online casino

添加新评论