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

  2. free casino games slots games free vegas slots online

  3. online casinos real money casino slot games online casino

  4. http://onlinecasinos911.com/# play casino cashman casino slots casino online slots big fish casino

  5. slots games http://onlinecasinos911.com/# play slots online real casino slots slots free

  6. http://freecreditreportss.com/# credit report dispute http://1creditscoreresults.com/# - get my credit report what is a credit score

  7. http://1creditscoreresults.com/# get credit report what is a perfect credit score check credit rating annual credit report official site

  8. real money casino http://onlinecasinos911.com/# online slots casino online casino game

  9. play casino slots for real money casino blackjack cashman casino slots free casino slot games

  10. transunion credit report http://getcreditscoreww.com/# - free equifax credit report request free credit karma official site annual credit report official site

添加新评论