I have a textarea which I select using jQuery, and I want to find the position of the cursor within it. I've found that in normal JavaScript you can do it with .selectionStart, but doing $("#maintext").selectionStart results in undefined.
How can I do it?