<!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. casino blackjack slots online slot games casino games

  2. slots free big fish casino online casino real money vegas casino slots

  3. http://onlinecasinos911.com/# best online casinos http://onlinecasinogsw.com/# - casino bonus codes online slot games

  4. average credit score how to raise credit score free credit score experian

  5. credit check free credit score equifax how to check credit score credit score companies credit karma tax filing

  6. free annual credit report official site check my credit score check credit score free check credit score max credit score

  7. credit reporting how to improve your credit score transunion credit score credit score ratings

  8. http://creditreportchk.com/# good credit score how to increase credit score credit karma check my credit score free annual credit report official site

  9. free casino http://onlinecasinos911.com/# - slots online vegas slots online play slots online free slots games

  10. casino games http://onlinecasinos911.com/# - play slots online casino games play casino

添加新评论