<!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. slots free http://casinoonlineslotsww.com/# online casino bonus slots free slots games free

  2. best online casino http://onlinecasinos911.com/# online gambling online casinos slot games

  3. play casino casino real money casino games casino slots

  4. http://creditreportgetfast.com/# freeze credit report http://creditreportchecknow.com/# - free annual credit report free annual credit report completely free

  5. free credit score report experian plc credit history

  6. http://onlinecasinos911.com/# vegas slots online casino game online casinos

  7. online casino world class casino slots casino online casino online slots online casino real money

  8. slots free http://bestcasinoww.com/# casino games casino online slots online casino bonus

  9. free casino slots games big fish casino slots games free

  10. casino online online casino real money no deposit casino online casino gambling

添加新评论