Does anyone know how to set focus to the last character of a textbox in javascript. For example when a page loads a value will be set in a textbox. Take the word "sample", for instance. I want to set focus to the textbox and the cursor should appear after the "e" in "sample". I've tried to populate that textbox and then set focus, hoping that the cursor would be at the end since there was already text in there, but it just put the cursor at the beginning of the word. Any help would be greatly appreciated!!