JavaScript: Cursor position in prompt box -


the default behaviour of prompt box selects entire text when opened. can behaviour changed custom position of mouse cursor within box?

prompt('please choose left window:', document.url);

enter image description here

for example want cursor pointed directly after //.

have @ example in jsfiddle
main idea remove selection following:

$input.focus(); $input.val($input.val()); 

first focusing input, resetting it's value.
it's dom based, , not work prompt window. based on authors comment question.


Comments

Popular posts from this blog

android - Inheriting from Theme.AppCompat* -

broadcastreceiver - android BOOT_COMPLETED not received if not activity intent-filter -

basic authentication with http post params android -