<!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. equifax credit score http://1creditscores.com/# - check my credit report credit score needed for mortgage credit bureau

  2. http://creditscoresids.com/# check credit score http://creditreportgetfast.com/# - credit sesame credit karma home

  3. credit score scale free credit report gov highest credit score check credit

  4. no deposit casino http://casinoonlineww.com/# online casino games free casino games big fish casino

  5. online casino online slots casino blackjack play casino

  6. free casino free casino games casino online slots free casino

  7. cashman casino slots http://casinorealmoneyiw.com/# - free slots games online casino real money casino real money

  8. casino online http://casinogamesejk.com/# - casino games cashman casino slots free casino slot games

  9. real casino slots online casino casino online free casino games online

  10. casino slots online casino slots online casino slots slots free online slot games

添加新评论