Can
var txt = $foo.text();
If you want everything in your element:
var html = $foo.html();
edit - oh wait; you also need an external tag. Hm. Well, you can clone it, wrap it in another div and get text or html from it, but something tells me that there might be a better way:
var $otherFoo = $foo.clone().wrap('<div/'); var html = $otherFoo.parent().html();
(or do it as @patrick suggests anything.)
source share