开发者

Get current line number in contenteditable

开发者 https://www.devze.com 2023-04-01 10:10 出处:网络
I have a contenteditable element w开发者_StackOverflowhich is being used for simple text editing. I need to get the current line number that the caret is on.

I have a contenteditable element w开发者_StackOverflowhich is being used for simple text editing. I need to get the current line number that the caret is on.

Is this possible? Here is my code for the contenteditable element.

<section contenteditable="true" id="writer">
    <p>write something</p>
</section>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号