1. Determine whether the text is empty
var jqObj = $( this);
if(jqObj.text().trim()){ //trim() method is to remove spaces, $.trim() function removes all line breaks and spaces (including non-breaking spaces) in the provided string ), start and end tab. If these whitespace characters occur in the middle of the string, they will be preserved.
jqObj.hide();
}
2. Determine whether there is a known element under this tag, such as determining whether there is a li element under the ul tag
var jqObj = $(this);
if(!jqObj. has('li').length){
jqObj.hide();
}