Created
November 9, 2012 13:38
-
-
Save ginotria/4045702 to your computer and use it in GitHub Desktop.
jQuery: Inline Style Remover
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
$.fn.removeStyle = function(style) | |
{ | |
var search = new RegExp(style + '[^;]+;?', 'g'); | |
return this.each(function() | |
{ | |
$(this).attr('style', function(i, style) | |
{ | |
return style.replace(search, ''); | |
}); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment