Okay I have list items, some have a span, some not. On my event I want to add the span when they don\'t have any yet.
has() works fine, but
has()
Try this,
$("a.add-span").click(function() { $("li:not(:has(span))").each(function(index) { $(this).append($("").html("Newly Added Span")); }); });