If a ul has more than one li-element inside of it, something should happen, otherwise not!
What am I doing wrong?
if ( $(\'
Warning: Answers above only work most of the time!
In jQuery version 3.3.1 (haven't tested other versions)
$("#myList li").length;
works only if your list items don't wrap. If your items wrap in the list then this code counts the number of lines occupied not the number of
$("#myList").children().length;
gets the actual number of