欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

初識JQuery 實(shí)例一(first)

 更新時(shí)間:2011年03月16日 23:51:02   作者:  
用jquery為ul下的li依次設(shè)置樣式的代碼,主要是利用了first,next方法。
完整代碼:
復(fù)制代碼 代碼如下:

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.highlight
{
background-color: yellow;
}
.gray
{
background-color: Gray;
}
</style>
<script src="http://code.jquery.com/jquery-1.5.js"></script>
</head>
<body>
<ul>
<li>Look:</li>
<li>This is some text in a paragraph.</li>
<li>This is a note about it.</li>
</ul>
<script type="text/javascript">
$("ul li").first().addClass('highlight');
jQuery("ul li").first().next().addClass('gray');
</script>
</body>
</html>

相關(guān)文章

最新評論