Forum Moderators: open
I just start learning JavaScript. How can I get the "actual x,y location" of the blinking cursor when a field is onfocus, either by user select the field or by TAB.
I tried many online mouse and cursor JavaScript codes but they are not what I want. The codes only get the mouse location, not the blinking cursor location when user select a field. The problem of the existing codes are:
1. When a user place the mouse cursor near the end of the field and select, the cursor location is showing at this location, not the real cursor location which is blinking at the beginning of the field.
2. When user put the mouse anywhere on the screen and used TAB to set focus to the field, the cursor or mouse location is only showing where the mouse is, not the blinking cursor.
Please help.
Thanks and best regards
Alex
Thanks for your help. Yes, I want the location of the "focus".
Actually I am also thinking to use the onfocus event for each input field. Actually I am also thinking the possibilities of getting the location of each text field.
Could you please advise more how can I use the onfocus event for each input field to set a global javascript variable with the field name and then retrieve the field name when you fire the onclick event for the cursor?
Best regards
Alex