• jquery获取一组radio被选中项的值


     

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
         <meta http-equiv="Content-Type" c/>
         <script type="text/javascript" src="jquery.js">
        </script>
         <script type="text/javascript">
             $(function(){
                 $('#form1').submit(function(){
                     var item = $('input[@name=items][@checked]').val();
                     alert(item);
                     return false;
                 });
             });
         </script>
         <title>Get Radio value Document</title>
    </head>
    <body>
         <form id="form1">
             <input type="radio" name="items" id="item1" value="a"/>A
             <br/>
             <input type="radio" name="items" id="item2" value="b"/>B
             <br/>
             <input type="radio" name="items" id="item3" value="c"/>C
             <br/>
             <input type="radio" name="items" id="item4" value="d"/>D
             <br/>
             <input type="radio" name="items" id="item5" value="e"/>E
             <br/>
             <input type="radio" name="items" id="item6" value="f"/>F
             <br/>
             <input type="radio" name="items" id="item7" value="g"/>G
             <br/>
             <input type="radio" name="items" id="item8" value="h"/>H
             <br/>
             <input type="submit" id="btn1">
         </form>
    </body>
    </html>
  • 相关阅读:
    Fiddler抓包
    用powershell Crescendo模块,把【linux字符命令】包装成【powershell对象命令】
    初探设计模式-单例模式
    dev的CheckedListBoxControl的使用
    git的安装及使用(三)----SSH连接
    go——杂碎小知识
    goland安装+打印hello world
    git的安装及使用(二)
    git的安装及使用(一)
    xxx
  • 原文地址:https://www.cnblogs.com/jxcia_Lai/p/1862926.html
Copyright © 2020-2023  润新知