I am trying to use jQuery to basically replace the cursor at the end of the text in a textbox AFTER the user hits "enter"
I have the "enter" part working - but I've no idea how [after the enter part] - I can get the cursor to return to the end of the inputted text inside the textbox ?
i.e. at the moment, when the user hits enter - the cursor goes to a new line and I want it to basically go to the end of the current text?
Some code:
jQuery('#textbox').keyup(function (e) {
if (e.keyCode == 13) {
... submits textbox
}
jQuery(this).focus(function() {
var val = this.input.value; //store the value of the element
this.input.value = ''; //clear the value of the element
this.input.value = val; //set that value back.
)};
});