Anyone knows a technique or method to find the position of the natural text line breaks in a textarea using javascript? It's not about finding \n or <br/>
's.
Asked
Active
Viewed 3,876 times
2
-
1Possibly similar question http://stackoverflow.com/questions/4719777/finding-line-breaks-in-textarea-that-is-word-wrapping-arabic-text – amitamb Mar 27 '12 at 13:30
-
1That's gonna be very hard to do, if possible at all. You could find them easily in a div though. – Alex Turpin Mar 27 '12 at 13:37
-
Wow that was fast! Thanks for the heads up, I will check that out. By natural I meant where it wraps in a textarea naturally, not by user entered line break. – somartist Mar 27 '12 at 13:50
-
Check it: http://stackoverflow.com/questions/863779/textarea-line-breaks-javascript – Sep 18 '12 at 18:19
1 Answers
0
It is not possible to do this directly, but the answer to this question uses a trick to find them where it adds characters one by one and checks for scrolling: finding "line-breaks" in textarea that is word-wrapping ARABIC text

Community
- 1
- 1

Kevin Borders
- 2,933
- 27
- 32