Created
November 14, 2012 16:11
-
-
Save sunny/4073020 to your computer and use it in GitHub Desktop.
OuterHTML jQuery plugin with polyfill for Firefox < 11
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
# OuterHTML jQuery plugin with polyfill for Firefox < 11 | |
# Example: | |
# $('ul').outerHTML() # => '<ul><li>Hi</li></ul>' | |
# $('ul').html() # => '<li>Hi</li>' | |
$.fn.outerHTML = -> | |
@[0].outerHTML || @clone().wrap('<b>').parent().html() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment