[jQuery] Do something, ONLY if parent has children

[jQuery] Do something, ONLY if parent has children


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;