File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Cursor position Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Cursor position " Watch "Cursor position " New topic

Cursor position

zheng yu

Joined: Apr 25, 2001
Posts: 28
how to know cursor position when user click the text field.
In my situation , there has no keyboard . Input device is touch panel & mouse . i created some buttons like DEL , BS , etc .user can use mouse to position , use these buttons to edit .
Ca this be done by using javascript ?
Thanx in advance
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
It depends on the browser. I'm not sure about Netscape, but in IE there is an event object passed to your event handler by default. Inside of your event that handles the button click you can simply inspect the event.x and event.y properties to get the coordinates of the click.
I agree. Here's the link:
subject: Cursor position
It's not a secret anymore!