
$.fn.outerHTML = function() {
return (this[0]) ? this[0].outerHTML : '';
};
// USAGE
$('selector').outerHTML();
CodePen Example
See the Pen OuterHTML Function For jQuery by Mike Doubintchik (@allurewebsolutions) on CodePen.

$.fn.outerHTML = function() {
return (this[0]) ? this[0].outerHTML : '';
};
// USAGE
$('selector').outerHTML();
See the Pen OuterHTML Function For jQuery by Mike Doubintchik (@allurewebsolutions) on CodePen.