find(expr)
从匹配元素集合中查找满足‘expr’表达式的匹配元素集合。返回匹配元素集合
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$("p").find("span").css('color','red');
});
</script>
</head>
<body>
<p><span>Hello</span>, how are you?</p>
<p>Me? I'm <span>good</span>.</p>
</body>
</html>
$("p").find("span").css('color','red');
从p元素匹配集合中查找出span元素,并对匹配的span元素集合进行操作。以下是匹配span元素集合
<span>Hello</span>
<span>good</span>