How to get the cursor position in TinyMCE or the number of line on which the cursor is in TinyMCE?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here is the part of a function from one of my own plugins i use to get the actual line number:
The function
getBoundingClientRect()is used to create a box from which we can get several positioning information. Be aware the we need to use a marker-element and reset the caret later on.Update: Info for lineHeight