In my project I'm trying to get the offset position of the caret in a textarea
in pixels. Can this be done?
Before asking here, I have gone through many links, especially Tim Down's, but I couldn't find a solution which works in IE8+, Chrome and Firefox. It seems Tim Down is working on this.
Some other links which I have found have many issues like not finding the top offset of the caret position.
I am trying to get the offset position of the caret because I want to show an auto-complete suggestion box inside the textarea
by positioning it based on the offset position of the caret.
PS: I can't use a contenteditable div
because I have written lots of code related to a textarea
.