Last active
August 29, 2015 14:15
-
-
Save cojahmetov/594d17e3dcd0dc55ec88 to your computer and use it in GitHub Desktop.
#jquery# remove style added with .css() function
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
| $.fn.removeCss=function(all){ | |
| if(all===true){ | |
| $(this).removeAttr('class'); | |
| } | |
| return $(this).removeAttr('style') | |
| } | |
| //For your case ,Use it as following : | |
| $(<mySelector>).removeCss(); | |
| //or | |
| $(<mySelector>).removeCss(false); | |
| //if you want to remove also CSS defined in its classes : | |
| $(<mySelector>).removeCss(true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment