Thanks Mike,

Could you explain your if statement for me, what does the && do?  I am
still learning js and jQuery. :)

On May 28, 5:10 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote:
> I would do it by checking the DOM directly, just because it's reasonably
> straightforward and very efficient:
>
>     var $main = $('#main');
>     if( $main[0] && $main[0].firstChild ) $main.hide();
>
> -Mike
>
> > I am wondering how I could check if a parent element has
> > children, and it it does not, I would like to hide the parent.
>
> > I was looking at something like the following, but I am not
> > sure how to get it to work how I want:
>
> > $("#main > *").hide;

Reply via email to