I've found a couple resources for how to place the cursor in a textarea at the end of the text, but I can't sort out a simple way to make it appear at the beginning.
I'm prepopulating the textarea with some text and just want to make it easier on the users.
$('textarea[name="mytextarea"]').focus().get(0).setSelectionRange(0,0);
... the addedget(0)
is to expose the DOM element sincesetSelectionRange()
is a DOM method rather than a jQuery one. – Quahog