Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Cross-browser outerHTML: return it, or if an argument was passed, replace the element.
$.fn.outerHTML = function(arg){
var $el = this;
return arg
? $el.replaceWith(arg)
: $el.clone().wrap('<b>').parent().html();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.