Created
February 1, 2011 09:43
-
-
Save balupton/805640 to your computer and use it in GitHub Desktop.
Fetch the outerHTML of an Element
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
/** | |
* Fetch the outerHTML of an Element | |
* @author Benjamin Arthur Lupton | |
* @license Public Domain | |
*/ | |
$.fn.outerHtml = $.fn.outerHtml||function(){ | |
var | |
$el = $(this), | |
el = $el.get(0), | |
html = el.outerHTML || new XMLSerializer().serializeToString(el); | |
return html; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment