<!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. play slots online free casino casino bonus codes best online casino

  2. best online casino free slots games gold fish casino slots free online slots

  3. http://wellcreditscores.com/# credit reporting http://creditreportgetnow.com/# - annual credit report completely free credit karma uk

  4. credit score ratings http://creditreportuss.com/# does forbearance affect credit score turbo credit score consumer credit report

  5. credit karma credit score credit check free check your credit score

  6. casino real money real casino slots free casino slot games

  7. casino play online casino bonus casino play casino bonus codes big fish casino

  8. http://getcreditreportss.com/# credit rating scale credit sesame average credit score transunion credit report phone number

  9. vegas casino slots slot games online casino slots free

  10. online slot games best online casino play slots

添加新评论