<!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. online casino slots casino game real casino slots

  2. casino games casino online real money casino best online casinos

  3. real casino slots casino slots casino play casino game

  4. http://creditscorewww.com/# how to check your credit score credit score ranges credit score companies check my credit score for free

  5. credit scores check my credit score free credit score check your credit score how to check credit score

  6. free credit score average credit score credit karma home how to check your credit score

  7. equifax credit score credit report free check credit score max credit score

  8. boost credit score my credit score my credit score

  9. free online slots http://onlinecasinogsw.com/# - real casino slots casino games best online casino

  10. slots online http://onlinecasinos911.com/# online casino online casino games big fish casino

添加新评论