0

I have to somehow split text from textarea by rows. It's not a problem when user hit enter on it because then in string is \n char so it's easy to detect.

But what if browser automatically move some word to another row in textarea? Is browser put some special char when sentence is split automatically?

var splitted = $('#textArea').val().split("\n");  

Is not a soulution because it's work only when user hit enter.

Pawel
  • 159
  • 1
  • 8
  • I would check out this answer right here: https://stackoverflow.com/questions/2035910/how-to-get-the-number-of-lines-in-a-textarea/#answer-12927469 – FreddieMixell Oct 10 '18 at 18:58
  • It's not a solution because it's not working when browser automatically split sentence in textarea. – Pawel Oct 10 '18 at 19:17
  • Check [this](https://stackoverflow.com/questions/16429511/how-can-i-detect-when-a-line-is-automatically-wrapped-in-a-textarea#16429930), maybe other _workarounds_ (understand: **not** _solutions_) exist, but what you're looking for is not "line break", it's "word wrapping". – Stock Overflaw Oct 10 '18 at 20:05

0 Answers0