Find the Caret starting and ending position in a textarea.
I have been looking for a function that will do this for a long time. Its amazing how many site claim to have a function that works, but does not. I would like to get it done here and hopefully others will find this post and not have to waste time. I have these simple requirements:
I input an ellement id (of a textarea in my case)
I get an output of both a start and an end value of the caret.
This must work in Ie6/Ie7/ff.
I have read numourous articles, and tried many functions all with their own problems.
The closest I got was one that worked perfectly however It would add the number of characters in multiple textboxes not just the one stated with its id inputted. Rendering it pretty useless.
This page has helped me get the closest but with problems still:
http://www.bazon.net/mishoo/articles.epl?art_id=1292
Thanks Heaps, Josh