Hmm. This one is tricky if it can be either a previous sibling of #yourimage or a descendant of a previous sibling. If you know it'll be a descendant of a previous sibling, you could do this:
$('#yourimage').prev().find('p:last');

At least it works for your example. ;)
--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Dec 11, 2006, at 4:48 PM, Anaurag Gupta wrote:

> Felix Geisendörfer
>
> How about:
> $("#yourimage").prev("p:last");

Nope. Again, am trying to find the first occurance of P, working backwards from the Img.

<body>
<p>don't find me</p>
<table><tr><td><p>don't find me</p></td><td><p>Find Me!</p></td></ tr></table>
<img id="yourimage" src="#" />
<p>don't find me</p>
</body>

Thanks in advance to all who might be able to help.

Anurag

Have a burning question? Go to Yahoo! Answers and get answers from real people who know.
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to