Javascript/Jquery - Reset text box view area after tab

Posted by JK on Stack Overflow See other posts from Stack Overflow or by JK
Published on 2010-06-09T00:36:33Z Indexed on 2010/06/09 0:42 UTC
Read the original article Hit count: 192

Filed under:
|
|
|

I don't know what this is called so its hard to google for it.

If you have a plain html input type=text with a small width eg 20 and then type more characters than can be displayed, it shows the last characters you type. And the first ones are scrolled out of view:

This is my long text // this is the whole string
my long string // this is what is actually visible in the input box

How do I make it so that when you hit tab, the view area resets so that the start of the string is visible and the end is hidden?

my long string // this is what is visible in the input box when typing
This is my // this is what is I want to be visible in the input box after you hit tab

What do you call this, and how do you do it?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery