当前位置:编程学习 > JAVA >>

jQuery学习笔记--Selector选择器

<!DOCTYPE html>  

<html>  

<head>  

<style>  

body { font-size:14px; }  

</style>  

<script src="http://code.jquery.com/jquery-latest.js"></script>  

</head>  

<body>  

 

 

<ul class="topnav">  

<li>Item 1</li>  

<li>Item 2  

<ul><li>Nested item 1</li><li>Nested item 2</li><li>Nested item 3</li></ul>  

</li>  

<li>Item 3</li>  

</ul>  

 

<script>$("ul.topnav > li").css("border", "3px double red");</script>  

 

</body>  

</html> 

 

 选择器:

 

<script>$("ul.topnav > li").css("border", "3px double red");</script>

摘自 Hurry的专栏

补充:web前端 , JavaScript ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,