Made it so that you can set the text value of elements to numbers (in addition to strings). (Fix for bug #1386)

This commit is contained in:
John Resig 2007-07-20 19:41:17 +00:00
parent 78db847ef2
commit 42f30dd181

View file

@ -565,7 +565,7 @@ jQuery.fn = jQuery.prototype = {
* @cat DOM/Attributes
*/
text: function(e) {
if ( typeof e == "string" )
if ( typeof e != "object" && e != null )
return this.empty().append( document.createTextNode( e ) );
var t = "";