Many jQuery methods are designed to automatically create elements from only half-written tags, like, "<span>"
for a .prepend() will result in an entire span element being added to the DOM. Or, as you'll see it in Firebug, "<span></span>"
inserted firstly in the anchor element.
I don't see why you'd want to create invalid HTML, but if you must, you can do it this way:
$("li > a").html("<span>"+$("li > a").html());
Or, as Reigel suggests, with an anonymous function to the .html() method (I wrote my answer rather quickly and, obviously, unthoughtfully):
$("li > a").html(function (idx, html) {
return "<span>" + html;
});
Otherwise, it could seem that you want to wrap the contents of the anchor element in a span. In that case, you should instead use one of the jQuery wrapping methods:
$("li > a").wrap("<span>");
You're not meant to create both the starting element and the closing element yourself (when using jQuery).