Chris,

Either Yehuda or my solution will work for you.

Take a look at 
http://docs.jquery.com/DOM/Traversing/Selectors#Custom_Selectors_2
for more info about the :first selector.

To use your example:

    $('#foo').parents('tr:first')
or
    $('#foo').parents('tr').eq(0)

Karl Rudd

On 1/16/07, Chris Domigan <[EMAIL PROTECTED]> wrote:
> Matt - I want the first ancestor of a certain type, not the first parent.
>
> Yehuda - won't this just select all tr's that are the first tr's in their
> table?
>
> To clarify, say I have this structure:
>
> <table>
>   <tr>
>     <td>
>       <table>
>         <tr>
>           <td>
>             <a id="foo">Demo</a>
>           </td>
>         </tr>
>       </table>
>     </td>
>   </tr>
> </table>
>
> I want to select the first <tr> it comes to while searching upwards (or
> outwards).
>
> Chris
>
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/
>
>
>

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to