<!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 report free get credit score how to check credit score experian credit score

  2. perfect credit score credit karma check my credit score free credit score report equifax credit score check my credit score credit karma

  3. credit report credit score check free credit karma highest credit score credit check

  4. online casinos http://playcasinovivo.com/# - world class casino slots casino games casino games slots free

  5. free casino games casino blackjack online slot games

  6. gold fish casino slots slots for real money play online casino slot games

  7. casino blackjack http://onlinecasinogsw.com/# online casino real money free casino free casino slot games

  8. online gambling http://onlinecasinogsw.com/# - real casino slots online gambling slots games free play casino

  9. credit score ratings chart credit score ranges credit score range karma free credit score credit score chart

  10. http://creditscorecheckww.com/# credit karma tax filing credit report free credit karma home

添加新评论