How to set and get cursor position in a text area | TinyMCE

How to set and get cursor position in a text area | TinyMCE