<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>www.plcxue.com - plc学堂</title>
<script type="text/
javascript" src="mytest/jQuery/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("li").has("span").css("color","green")
})
</script>
</head>
<body>
<div>
<ul>
<li><span>HTML专区</span></li>
<li class="js">Javascript专区</li>
<li>Div+Css专区</li>
<li>Jquery专区</li>
</ul>
</div>
</body>
</html>
匹配含有span元素的li元素,并将其中的字体颜色设置为绿色。