The following article is one of my most popular organic search from Google, thus I thought I would share it here as well. In the following example, I will create some basic functions to allow you to set where the cursor goes inside of a <textarea> or <input type=”text”>. By using the setSelectionRange or the createTextRange, it will allow you to set the mouse cursor position of a form element item such as a textarea, input box, etc…