troubleshooting Question

Where is the cursor in a textbox

Avatar of tonelm54
tonelm54 asked on
JavaScriptCSSHTML
4 Comments1 Solution399 ViewsLast Modified:
I know its possible to find out where the cursor is in a textbox however what Im looking to do is find the actual position of the cursor, so I can put a CSS div just below it, so I can put suggestions in for an intelisence feel.

My first idea was to calculate the text before, and add up each character spacing, and work out where lines would terminate etc, so I can work out the x&y position of the element, but surely there is an easier way of finding this out.

My other issue with my idea, is I have no idea where the scroll bar would be located, nor a way of detecting the scroll value, so it wouldn't work.

Any suggestions?

Thank you
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros