You can use .is()
.
if( $('#leftmenu').is(':empty') ) {
Or you could just test the length
property to see if one was found:
if( $('#leftmenu:empty').length ) {
You can use $.trim()
to remove whitespace (if that's what you want) and check for the length of the content.
if( !$.trim( $('#leftmenu').html() ).length ) {