You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to get the line number? I've tried splitting the innerHTML of the div by "<br>" and finding the length of the first string. If the string has length, I can see if the caret position is greater than or equal to the length and if this is true, the caret is either at the end of the first line or below. However, if the first line is empty and the innerHTML consist of only new lines, I haven't been able to find a way of working out the caret line number.
Does anyone know of a solution to find out the caret line number no matter the content of the div?
The text was updated successfully, but these errors were encountered:
We're able to get the index of the caret by doing something like this:
Is it possible to get the line number? I've tried splitting the
innerHTML
of the div by"<br>"
and finding the length of the first string. If the string has length, I can see if the caret position is greater than or equal to the length and if this is true, the caret is either at the end of the first line or below. However, if the first line is empty and theinnerHTML
consist of only new lines, I haven't been able to find a way of working out the caret line number.Does anyone know of a solution to find out the caret line number no matter the content of the div?
The text was updated successfully, but these errors were encountered: