This version is old school.
Please find jQuery plugins on npm.
jquery.outerHtml
A simple jQuery plugin to get or set a node's outer HTML, a la IE's [formerly] proprietary `outerHTML` property on elements. Get the outer HTML contents of the first node in the set of matched elements or set the outer HTML contents of every matched node.