I have this text box:
<input type="text" name="url" id="url-input" />
and this code:
var inputText = "Hello World";
$(document).ready(function() {
$("#url-input").focus();
$("#url-input").val(inputText);
});
As it is, the cursor is displayed at the end of the textbox after the words "Hello World" (no matter in which order I add focus or change the value). How can I move it to the front?
Thanks
EDIT - Here's the jsFiddle: http://jsfiddle.net/dmRND/