JqueryDOM操作-样式操作

来源:互联网 发布:ubuntu 更改用户组 编辑:程序博客网 时间:2024/04/26 03:53
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery_demo</title>
</head>
<!--引入jquery类库-->
<script src="jquery/jquery-1.3.1.js" type="text/javascript">
</script>
<style type="text/css">
.high{
font-weight:bold;
color:red;
background-color:yellow;
width:250px;
height:250px;
}
.another{
font-style:italic;
color:blue;
}
</style>
<script type="text/javascript">
//jquery格式$(function(){});
$(function(){
//获得全部替换
$("ul li:eq(0)").attr("class","high");
});
</script>
<body>
<ul>
<li title='邯郸清华万博'>邯郸清华万博</li>
<li title='邯郸北大青鸟'>邯郸北大青鸟</li>
<li title='邯郸领创教育'>邯郸领创教育</li>
</ul>
</body>
</html>
原创粉丝点击