<!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. experian business credit report http://freecreditreportss.com/# - freeze credit report check credit score credit karma check my credit score

  2. http://casinoonlineslotsww.com/# free online slots http://casinogameww.com/# - slots online free casino games

  3. vegas casino slots vegas slots online gold fish casino slots

  4. real money casino http://casinobonuscodesww.com/# casino play no deposit casino online casino

  5. free online slots casino game online casinos slots online

  6. online casino gambling big fish casino online casino games vegas slots online

  7. free casino slots online slots free slots free online slots

  8. online casino games online casino gambling casino real money

  9. online slot games online casino gambling casino online casino game

  10. annual credit report com credit score chart how to read credit report equifax credit score

添加新评论