Posted By

trey on 10/09/08


Tagged

jquery


Versions (?)

Who likes this?

9 people have marked this snippet as a favorite

awesomehappened
sidisinsane
Hollow
naehrstoff
talbs
keith
Flocke
seanpowell
guo3823538


jQuery toggleText


 / Published in: JavaScript
 

URL: http://dev.jquery.com/ticket/1092

  1. jQuery.fn.toggleText = function(a, b) {
  2. return this.each(function() {
  3. jQuery(this).text(jQuery(this).text() == a ? b : a);
  4. });
  5. };

Report this snippet  

You need to login to post a comment.