<!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 online slot games slot games play slots online

  2. free casino slot games casino real money slots games online slots

  3. vegas slots online online casino real money casino real money

  4. gold fish casino slots cashman casino slots online casino slots online casino slots

  5. slots games http://casinogamesmn.com/# free online slots online slot games play slots

  6. http://creditscorecheckn.com/# what is a great credit score http://wellcreditscores.com/# - credit score needed for mortgage credit karma check my credit score

  7. casino bonus codes slots for real money vegas slots online slots for real money

  8. http://wellcreditscores.com/# minimum credit score for mortgage http://creditreportwwm.com/# - how to raise your credit score fast annualcreditreport

  9. real casino slots online slots best online casinos

  10. big fish casino best online casinos vegas casino slots vegas casino slots casino slots

添加新评论