Skip to content

Instantly share code, notes, and snippets.

@trey
Created October 9, 2008 21:15
Show Gist options
  • Save trey/15897 to your computer and use it in GitHub Desktop.
Save trey/15897 to your computer and use it in GitHub Desktop.
jQuery ToggleText
// http://dev.jquery.com/ticket/1092
jQuery.fn.toggleText = function(a, b) {
return this.each(function() {
jQuery(this).text(jQuery(this).text() == a ? b : a);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment