Consider the following markup:
<x>
<y>code1</y>
<z>stuff</z>
开发者_如何学运维 <y>code2</y>
<z>foobar</z>
</x>
Using jQuery, how do I select the <z>foobar</z>
node in the given markup using the following rule: find the z
-node that follows after a y
-node which has a body containing "code2"
?
Like this:
$('y:contains("code2") + z')
精彩评论