JSFiddle - React, Tailwind, and code Playground
by ariehg
HTML
<a href='b'>asasd</a>
JavaScript
jQuery.fn.outerHTML = function(s) {
return (s)
? this.before(s).remove()
: jQuery("<p>").append(this.eq(0).clone()).html();
};
console.log($('a').outerHTML());