jQuery toggleText


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. jQuery.fn.toggleText = function(a, b) {
  2. return this.each(function() {
  3. jQuery(this).text(jQuery(this).text() == a ? b : a);
  4. });
  5. };

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.