drayarms Posted September 2, 2011 Share Posted September 2, 2011 hello people, I'm using the following line to change the value of a text input from it's default, to an empty string when an event takes place: onevent = ("#target_id").val(""); But the overall goal is to actually get cursor to position itself in the text field when the even is triggered, not just to simply erase the default value of the text field. How can that be achieved? Quote Link to comment Share on other sites More sharing options...
requinix Posted September 2, 2011 Share Posted September 2, 2011 Use .focus() to give the field focus (and thus, because it's a text box, the cursor). Quote Link to comment Share on other sites More sharing options...
drayarms Posted September 3, 2011 Author Share Posted September 3, 2011 @requinix, thanks. works perfect Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.