You can check it in various ways.

if ($('#element').is(':empty')){
   //write your code here
}

OR

if ( $('#element').text().length == 0 ) {
   // length is 0
}

BY Best Interview Question ON 29 Jun 2019