jquery – get number of li inside a ul element [duplicate]

You can use .has() selector:

if(!$('ul').has('li')){//ul is empty

}

Leave a Comment