How to get number of rows in ContentEditable area and current caret line position?
问题 my question has two parts, but they are related. Firstly - I have Contenteditable DIV with some text and I need to get total number of rows (lines) of this DIV. Is it possible ? Secondly - I need to get caret row position, if it is on row number 1, 2, 3, etc.... Can anybody help ? 回答1: The direct answer is that there is no method that actually gets you those numbers. However, there are a number of different work arounds which you can apply to estimate (I use estimate , because I don't think