get caret position in a contenteditbable div that has multiple lines

تبليغ
سؤال

يرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.

تبليغ
‎إلغاء

I am trying to get the caret position in a contenteditable div that has multiple html elements and multiple lines.

I found good solution that returns the caret position based on text only – this is not what I’m looking for.

The best solution I found until now is explained here. the problem is this does not returns the caret position in a multiple line div scenario.

please help.

thanks in advance,

‫أضف إجابة

تصفح
تصفح

مجهول يجيب