html
is a method not a property, you need to use ()
, then you can use length
property of String object for checking the length of the returned html string:
if ( $.trim( $('.'+rowName+' div').html() ).length ) {
// $('.'+rowName).find('div, p, span').remove();
$('.'+rowName).find('div, p, span').empty();
}
Note that if you want to change the HTML content of an element, there is no need to remove the current html content of it. html
method overrides the current html content.