Skip to content

Instantly share code, notes, and snippets.

@colelawrence
Created June 5, 2014 18:58
Show Gist options
  • Save colelawrence/ba3dea036dbaec5053c4 to your computer and use it in GitHub Desktop.
Save colelawrence/ba3dea036dbaec5053c4 to your computer and use it in GitHub Desktop.
add class to an element, remove from element's siblings
$.fn.transferClass = function (className) {
this.siblings().removeClass(className)
this.addClass(className)
return this
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment