<!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. my credit report http://1creditscoreresults.com/# free credit karma official site check credit free credit score equifax

  2. free credit check freeze credit report get my credit score http://creditscorecheckn.com/#

  3. credit score scale annualcreditreport com credit report scores creditkarma http://creditreportchecknow.com/# - free credit report gov

  4. real casino slots http://nodepositcasinoww.com/# - big fish casino online casino bonus free slots games slots games free

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

  6. casino blackjack world class casino slots online casino games online slots

  7. online casinos slots online casino online

  8. play slots online big fish casino real casino slots

  9. online casinos online casinos vegas casino slots casino game

  10. http://freeonlinecasinoslotsww.com/# online casino slots casino online free casino games vegas casino slots

添加新评论