yes, it is, but it requires a lot of code. What you want to do is return the position of the caret in the text box rather than the whole mouse position.

http://www.faqts.com/knowledge_base/...d/1052/fid/130

If you are interested you can get the mouse position too.

http://getelementbyid.com/tutorials/...se/index.shtml