<!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. how to increase your credit score fast credit scores chart good credit score range free equifax credit report http://1creditscores.com/# - equifax free credit report

  2. casino bonus codes http://onlinecasinogamesww.com/# no deposit casino gold fish casino slots casino slots

  3. slots online real casino slots vegas slots online

  4. free slots games online casino bonus real casino slots slots games slots for real money

  5. play slots free casino games casino slots online casino games

  6. credit report my free annual credit report credit karma home transunion credit report phone number http://wellcreditscores.com/#

  7. credit monitoring http://wellcreditscores.com/# credit karma com free credit score equifax credit score national credit report

  8. credit score check http://creditscoresws.com/# - free yearly credit report how to increase credit score how to get a credit report

  9. free credit reports free business credit report experian credit my annual credit report free http://getcreditscoreww.com/# - check my credit score for free

  10. play slots online http://casinoonlineslotsww.com/# - online slots online casino gambling online casinos

添加新评论