[jQuery] Re: help using parent()

2009-05-19 Thread Ricardo
IDs have better performance, but classes applied to multiple elements allow you to simplify logic and code. eric 1 eric 2 var x = $('#row_3'), y = x.parents('.section:first'); The same applies to the TR ids, but I don't know the whole context to propose anythi

[jQuery] Re: help using parent()

2009-05-19 Thread elubin
parents() worked, thank you. also the new closest() worked. what's the exact difference between those two? why classes instead of ids? is better than ? why? performance of jquery selectors? On May 19, 1:53 pm, aquaone wrote: > A will never be a parent of a . It will be an ancestor but n

[jQuery] Re: help using parent()

2009-05-19 Thread aquaone
A will never be a parent of a . It will be an ancestor but not a direct parent. .parents() will look for ancestors. In other news, please use classes on your s instead of pattern matching the id. It's better for a variety of reasons. aquaone On Tu

[jQuery] Re: help using parent()

2009-05-19 Thread Andy Matthews
You might try just var y = x.parent('div'); Would there ever be another div that could be a parent of one of these TD tags? -Original Message- From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of elubin Sent: Tuesday, May 19, 2009 12:47 PM To: jQuery (Engli