<!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. credit score chart what is an excellent credit score fico credit score get a free credit report http://creditreportwwm.com/# - annual credit report completely free experian

  2. how to improve my credit score http://creditscoresfx.com/# credit bureau reports free credit report free credit report experian

  3. dispute credit report http://creditscoresids.com/# annualcreditreport credit report scores karma credit score

  4. credit report free http://creditreportchecknow.com/# - fico credit score what is a good credit score equifax credit score credit score ranges

  5. online casino slots http://onlinecasinos911.com/# online slot games online slot games slots for real money

  6. play slots big fish casino real money casino cashman casino slots

  7. http://onlinecasinos911.com/# free casino slot games free slots

  8. credit score scale freecreditreport credit karma check your credit report http://creditreportgetfast.com/# - credit karma free credit report

  9. no deposit casino free slots games slots online free casino games online http://casinogamesww.com/# - casino online

  10. best online casinos http://casinogamesejk.com/# casino blackjack free casino games play slots online

添加新评论