<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="jQuery2/WebContent/scripts/jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function(){
//包裹指定li
$("#city li").wrap("<font color='darkgoldenrod'></font>");
//包裹所有li
$("#game li").wrapAll("<font color='#AAAAAA'></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>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="jQuery2/WebContent/scripts/jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function(){
//包裹指定li
$("#city li").wrap("<font color='darkgoldenrod'></font>");
//包裹所有li
$("#game li").wrapAll("<font color='#AAAAAA'></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>