Skip to content Skip to sidebar Skip to footer

Jquery Focus Textbox And Go To End, But Also Set The Position Of The Cursor So User Can See It?

So here's what I'm working on: http://jsfiddle.net/hn8EY/ $('input').mouseup(function(){ this.selectionStart = this.value.length; this.selectionEnd = this.value.length; });

Solution 1:

Try setting the scrollLeft:

$("input").mouseup(function(){
    var valLength = this.value.length;
    this.setSelectionRange(valLength , valLength ); //or this.selectionStart = this.value.length; this.selectionEnd = this.value.length;//or just use this.selectionStart = this.value.length;this.scrollLeft = this.scrollWidth;
});

Fiddle

Post a Comment for "Jquery Focus Textbox And Go To End, But Also Set The Position Of The Cursor So User Can See It?"