If the content of a HTML textbox is longer than the textbox width, part of it is hidden and you need to scroll the textbox to see the end. Is there anyway to scroll it in JS or CSS to the end?
Width
Here's for an <input type="text" />
and width.
var ta = document.getElementById('temp');
ta.scrollLeft = ta.scrollWidth;
And my fiddle is updated to show this.
Here's my previous response with doing it for the height.
Height
You can use scrollHeight and scrollTop on an element to do this.
var ta = document.getElementById('temp');
ta.scrollTop = ta.scrollHeight;
Fiddle: http://jsfiddle.net/derekaug/JGqtA/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With