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 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 "deleting" a row, I want to test if there are any more rows with
>> the tbody. If not, I want to hide the thead.
>>
>> This logic test returned false:
>> $('tbody', '#documents').html() == ''
>
>
>