Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Focus input field with JQuery without selecting current value text

$("#myinputfield").focus(); 

Doing that on an input field with it's value already set causes the current value to be selected. How can I focus the field without selecting the text?

like image 873
Alastair Stuart Avatar asked Nov 18 '09 15:11

Alastair Stuart


1 Answers

I've searched around a bit and kinda found out that you should re-set your value into the desired field after it is focussed on.

like image 92
Ben Fransen Avatar answered Sep 18 '22 19:09

Ben Fransen