In this specific case:
var outerHTML = $("<div />").append($('#example').clone()).html();
See this page for more details.
And the discussion here: http://api.jquery.com/html/ (this explains that this isn't in jQuery core and why some logical solutions won't work)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…