thats cool. But what if an element has no id or is not the only sibliing with 
that class? you need to add its position within the parent in that case, which 
is actually more useful.

but, this is only only worth it if jQuery supports td:1 vs td:first which I'm 
not sure it does.

----- Original Message ----
From: Dave Cardwell <[EMAIL PROTECTED]>
To: jQuery (English) <jquery-en@googlegroups.com>
Sent: Friday, April 27, 2007 5:12:53 AM
Subject: [jQuery] Re: path and selectors


Alexandre Plennevaux wrote:
> hello!
>  
> i would like to know if there is a way to have jquery tell you what is 
> the DOM path to an element. For example:
>  
> $(this).click(function(){
> alert($(this).getPath();
> });
>  
>  
> which would output
>  
> html > body > div.col > ul.menu > li > a.selected


Ask and ye shall receive!

http://davecardwell.co.uk/javascript/jquery/plugins/jquery-getpath/


-- 
Best wishes,
Dave Cardwell.

http://davecardwell.co.uk/javascript/jquery/

Reply via email to