Skip to content

Instantly share code, notes, and snippets.

@cojahmetov
Last active August 29, 2015 14:15
Show Gist options
  • Select an option

  • Save cojahmetov/594d17e3dcd0dc55ec88 to your computer and use it in GitHub Desktop.

Select an option

Save cojahmetov/594d17e3dcd0dc55ec88 to your computer and use it in GitHub Desktop.
#jquery# remove style added with .css() function
$.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