You can use .has()
selector:
if(!$('ul').has('li')){//ul is empty
}
More Related Contents:
- jQuery split long ul list in smaller lists
- Number nested ordered lists in HTML
- How to change the bootstrap css width into 1000px? [closed]
- jquery’s append not working with svg element?
- call Fancybox in parent from iframe
- Slide right to left?
- How to get the full path of the file from a file input [duplicate]
- Google ReCAPTCHA how to make required?
- ‘dragleave’ of parent element fires when dragging over children elements
- Find size of file behind download link with jQuery
- Convert a HTML table data into a JSON object in jQuery
- How to draw a line between draggable and droppable?
- How to fade loop background images?
- Why is z-index ignored with position:static?
- Access Multiple Elements of same ID in jQuery
- Limit number of characters in input field
- Bootstrap CSS Active Navigation
- JQM (jQueryMobile) Dynamically added elements not displaying correctly and CSS is not applied
- Wrap elements inside a div using jQuery
- Force a checkbox to always submit, even when unchecked
- access div in iframe parent
- submit disabled fields
- What’s faster for including scripts, using CDN (Google) or storing them locally in website’s root?
- JQuery search in static HTML page with highlighting of found word
- Disable select options based on value *through the HTML only!*
- Selectable optgroup using select2
- Html5 drag and drop on svg element
- Possible to have a floating horizontal scrollbar?
- change the href of a css link via jquery
- Can jQuery selectors be used with DOM mutation observers?