You can use .has()
selector:
if(!$('ul').has('li')){//ul is empty
}
4
solved jquery – get number of li inside a ul element [duplicate]
You can use .has()
selector:
if(!$('ul').has('li')){//ul is empty
}
4
solved jquery – get number of li inside a ul element [duplicate]