• jquery 包装


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <title>Untitled Document</title>
            
            <script type="text/javascript" src="scripts/jquery-1.7.2.js"></script>
            <script type="text/javascript">
                
                //测试使用 jQuery wrap, wrapAll, wrapInner
                $(function(){
                    
                    //包装 li 本身
                    $("#game li").wrap("<font color='red'></font>");
                    
                    //包装所有的 li
                    $("#city li").wrapAll("<font color='red'></font>");
    
                    //包装 li 里边的文字. 
                    $("#language li").wrapInner("<font color='red'></font>");
                })
                
            
            </script>
            
        </head>
        <body>
            <p>你喜欢哪个城市?</p>
            <ul id="city">
                <li id="bj" name="BeiJing">北京</li>
                <li>上海</li>
                <li id="dj">东京</li>
                <li id="se">首尔</li>
            </ul>
            
            <br><br>
            <p>你喜欢哪款单机游戏?</p>
            <ul id="game">
                <li id="rl">红警</li>
                <li>实况</li>
                <li>极品飞车</li>
                <li>魔兽</li>
            </ul>
            
            <br><br>
            <p>你喜欢哪种开发语言?</p>
            <ul id="language">
                <li>C</li>
                <li>Java</li>
                <li>.NET</li>
                <li>PHP</li>
            </ul>
            
            <br><br>
            gender: 
                <input type="radio" name="gender" value="male"/>Male
                <input type="radio" name="gender" value="female"/>Female
        
            <br><br>
            name: <input type="text" name="username" value="atguigu"/>
            
        </body>
    </html>    
  • 相关阅读:
    【lc-database】595. 大的国家
    Visual Studio 2010软件安装教程
    Win10系统下安装VC6.0教程
    HTTP协议
    正则表达式
    类装饰器
    装饰器工厂函数
    装饰器函数
    闭包
    web服务器
  • 原文地址:https://www.cnblogs.com/lxh520/p/8879590.html
Copyright © 2020-2023  润新知