Created
August 6, 2010 14:16
-
-
Save bgrins/511371 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
jQuery outerHTML plugin with ownerDocument fix | |
See: http://www.briangrinstead.com/blog/jquery-outerhtml-snippet | |
Based off of: http://brandonaaron.net/blog/2007/06/17/jquery-snippets-outerhtml/ | |
*/ | |
$.fn.outerHTML = function() { | |
var doc = this[0] ? this[0].ownerDocument : document; | |
return $('<div>', doc).append(this.eq(0).clone()).html(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment