JQuery Sprawdź, ile elementów dziecka
var count = $("#selected ul").children().length;
Weary Wildebeest
var count = $("#selected ul").children().length;