jQuery.fn.textFast = function(text) { if (jQuery.isFunction(text)) { return this.each(function(i) { var self = jQuery(this); self.text(text.call(this, i, self.text())); }); } if (typeof text !== "object" && text !== undefined) { return this.empty().append((this[0] && this[0].ownerDocument || document).createTextNode(text)); } return jQuery.textFast(this); }; jQuery.textFast = function(elems) { var ret = "", elem; for (var i = 0; elems[i]; i++) { elem = elems[i]; // this part is new. ret += elem.textContent || elem.innerText || jQuery.text( elem.childNodes ); //to fix a scoping issue in IE6 with Sizzle.getText(elem.childNodes); } return ret; };