I\'m trying to get the HTML of a selected object with jQuery. I am aware of the .html() function; the issue is that I need the HTML including the selected obje
.html()
jQuery plugin as a shorthand to directly get the whole element HTML:
jQuery.fn.outerHTML = function () { return jQuery('').append(this.eq(0).clone()).html(); };
And use it like this: $(".element").outerHTML();
$(".element").outerHTML();