Merge pull request #1937 from xiaody/patch-2

Safer $.fn.selectEnd
This commit is contained in:
Albert Yi
2013-08-14 10:42:15 -07:00

View File

@@ -102,7 +102,9 @@
}; };
$.fn.selectEnd = function(){ $.fn.selectEnd = function(){
this.selectRange(this.val().length, this.val().length); if (this.length) {
this.selectRange(this.val().length, this.val().length);
}
return this; return this;
} }
})(); })();