How to get the caret column (not pixels) position in a textarea, in characters, from the start?

How to get the caret column (not pixels) position in a textarea, in characters, from the start?

How do you get the caret position in a