<div class="wrap"><div class="in"></div></div>
var wrap = $('.wrap'); console.log(wrap.<...>());
<script src="http://yandex.st/jquery/1.9.1/jquery.min.js"></script> <div class="xxx">asfasf</div> <script> $.fn.outerHtml = function(){ return this[0].outerHTML || new XMLSerializer().serializeToString(this[0]); } alert($('.xxx').outerHtml()); </script>
if (!('outerHTML' in document.documentElement)) { Object.defineProperty(Element.prototype, 'outerHTML', { get: function() { return new XMLSerializer().serializeToString(this); } }); } alert(document.documentElement.outerHTML);
alert(document.documentElement.outerHTML);