Created
July 25, 2013 07:03
-
-
Save malachi358/6077468 to your computer and use it in GitHub Desktop.
Remove Inline Styles with Jquery Plugin.
This file contains hidden or 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
(function($) | |
{ | |
$.fn.removeStyle = function(style) | |
{ | |
var search = new RegExp(style + '[^;]+;?', 'g'); | |
return this.each(function() | |
{ | |
$(this).attr('style', function(i, style) | |
{ | |
return style.replace(search, ''); | |
}); | |
}); | |
}; | |
}(jQuery)); | |
//-fallowing is the target element and style to be removed-// | |
$('#element').removeStyle('style'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment