[jQuery] Re: determining if table contains rows

2008-02-17 Thread Karl Swedberg
To see if there are any tr elements inside the tbody, use the length property: if ($('tbody tr', '#documents').length) { $('thead').hide(); } --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 17, 2008, at 1:02 PM, Shelane wrote: After

[jQuery] Re: determining if table contains rows

2008-02-17 Thread Shelane Enos
Worked perfectly with one modification (reverse of logic) if ($('tbody tr', '#documents').length == 0) { $('thead').hide(); } Thanks. I guess I haven't used the as part of any of my selectors before. On 2/17/08 11:10 AM, Karl Swedberg [EMAIL PROTECTED] wrote: To see if there are any

[jQuery] Re: determining if table contains rows

2008-02-17 Thread MorningZ
Karl (or anyone else that wants to answer), Since you answered his question, i was hoping i could ask one based on your answer Is there any difference/advantage between $('tbody tr', '#documents') and $('#documents tbody tr') I'm still only a few months into jQuery and have yet to use