Skip to content
Permalink
Browse files

Fixed the issue with .text() returning incorrect results.

  • Loading branch information
jeresig committed Jul 5, 2006
1 parent a208222 commit f96c860bbd754f64ccc427a7308f4b3faf2f2814
Showing with 6 additions and 5 deletions.
  1. +6 −5 jquery/jquery.js
@@ -110,11 +110,12 @@ jQuery.fn = jQuery.prototype = {
text: function(e) {
e = e || this.get();
var t = "";
for ( var j = 0; j < e.length; j++ )
for ( var i = 0; i < e[j].childNodes.length; i++ )
t += e[j].childNodes[i].nodeType != 1 ?
e[j].childNodes[i].nodeValue :
jQuery.fn.text(e[j].childNodes[i].childNodes);
for ( var j = 0; j < e.length; j++ ) {
var r = e[j].childNodes;
for ( var i = 0; i < r.length; i++ )
t += r[i].nodeType != 1 ?
r[i].nodeValue : jQuery.fn.text([ r[i] ]);
}
return t;
},

0 comments on commit f96c860

Please sign in to comment.
You can’t perform that action at this time.