[jQuery] Ancestors of a node
Is it possible, using jquery, to do something like find the nearest
enclosing div of a given node? For example:
<script>
function test(self) {
// somehow find the nearest enclosing 'div' around the 'a'.
}
</script>
<div>
...
<div> <!-- Find this one -->
...
<a href="#" onclick="test(this)">Press me</a>
</div>
</div>
I tried the ancestor xpath axes but I don't think it's implemented? Any ideas?
Chris.
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/