Skip to content

Instantly share code, notes, and snippets.

@remibreton
Last active December 23, 2015 07:09
Show Gist options
  • Save remibreton/6599113 to your computer and use it in GitHub Desktop.
Save remibreton/6599113 to your computer and use it in GitHub Desktop.
function removeClass(element, cls){
if(typeof element.classList !== "undefined"){
element.classList.remove(cls);
return element;
} else {
if(element.className.indexOf(cls) != -1){
element.className = element.className.replace(cls, '');
}
return element;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment