"duzuike" wrote
I can set focus on a text field. But the cursor is always stay at
the beginning , how to set the cursor at the end ?
Thank you.
In some browsers, including IE and FF, the trick is to set the value of the
element after setting the cursor. The cursor will then be moved with it as
the new value is written and end up at the end...
tt.focus(); tt.value = tt.value;
Otherwise, you will need to manipulate text selection ranges, which is a
pain to do crossbrowser.
hth
ivo
http://4umi.com/