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

  2. slots for real money play casino world class casino slots online casinos

  3. http://casinoonlineslotsww.com/# play casino http://onlinecasinowps.com/# - casino online cashman casino slots

  4. http://onlinecasinos911.com/# online casino real money online casino slots cashman casino slots free casino

  5. karma free credit score check credit score full credit report credit report definition http://getcreditreportss.com/# - how to dispute credit report

  6. online casinos online casino gambling slots games free online casino

  7. free slots games casino online play slots online slots games play online casino

  8. http://1creditscores.com/# credit monitoring how to get credit report how to increase your credit score fast my free annual credit report com

  9. online casino real money vegas slots online online casino slots casino games slot games

  10. online casino slots play casino casino play

添加新评论