[jQuery] Re: Shortest Selector

2007-05-22 Thread Daemach
It depends on how much control you have over the original HTML. If you're generating it from a dynamic language like coldFusion, ASP, PHP, etc. and you will always be linking a specific link with a specific div AND you don't mind adding ID's the fastest selector is $ ('#'+this.id.split("_")[1]);

[jQuery] Re: Shortest Selector

2007-05-22 Thread Glen Lipka
But your answer is much longer than $(this).parents("tr").next("tr").find("div") I'm not saying I want to bind the click or get the value of the DIV. I just want to find it with a single selector. Actually I plan to slideDown() the Div using Toggle on the A. Glen On 5/22/07, Sean Catchpole <[E

[jQuery] Re: Shortest Selector

2007-05-22 Thread Sean Catchpole
I believe that might be the shortest way to get the element, however if speed is your concern, then I suggest storing the divs before hand. Give this code a try: var div = $("tr td div"); $("tr td a").each(function(i){ $(this).click(function(){ alert(div[i].innerHTML); return false; }); }

[jQuery] Re: Shortest Selector

2007-05-22 Thread Jean Nascimento
i want to lnow too, and including a question How can I remove the TR who includes the finded element? On 5/22/07, Glen Lipka <[EMAIL PROTECTED]> wrote: ONE TWO What is the shortest Selector to find the DIV if one starts with A (this) This is the best I got, but