How can I use JavaScript to determine if a UL contains 1 or more LI's within?
Pseudo code
if('ul#items' has >= 1 LI){
Thanks,
With jQuery:
$('ul#items li').length >= 1
Without jQuery:
document.getElementById('items').getElementsByTagName('li').length >= 1
With jQuery:
if( $('#items li').length >= 1 ){...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With