jQuery wrap span around text
For your current example here is my one line solution:
$("div span").detach().prependTo($("div").contents().wrap("<span />").end());
DEMO: http://jsfiddle.net/awwTA/
For your current example here is my one line solution:
$("div span").detach().prependTo($("div").contents().wrap("<span />").end());
DEMO: http://jsfiddle.net/awwTA/