jquery 扩展 outerHTML
jQuery.fn.outerHTML = function(s) {return (s)? this.before(s).remove(): jQuery("<p>").append(this.eq(0).clone()).html();}
alert($("#test").outerHTML());