0

I'm working on a project where I need to split a textarea at a specific row (Which dynamically changes).

I tried using a solution where I split the textarea at new lines:

$('#textAreaID').val().split('\n');

but this only splits when the user have manually pressed enter, which doesn't work for my project. How do I achieve something similar, just with the split actually splitting each row, regardless of user-input?

Clarification edit: enter image description here

Here I have my textarea, which consists of 4 paragraphs, created with manual breaks, and 13 rows. I need to create two seperate textareas, for example textarea1 (row 1 - 7) and textarea2 (row 8 - 13). As this is inside a paragraph, I need to find a way of dividing that text, on a row-basis, compared to the already presented new-line solution.

ok34332
  • 71
  • 7
  • 1
    You want to take soft wrapping into account? Not sure if that's even possible with text area – Ja͢ck Mar 24 '20 at 16:37
  • 1
    Perhaps [this](https://stackoverflow.com/questions/4719777/finding-line-breaks-in-textarea-that-is-word-wrapping-arabic-text) could help you further – Ja͢ck Mar 24 '20 at 16:38
  • Not sure what you mean by "_textarea at a specific row_". some examples would help to understand. – palaѕн Mar 24 '20 at 16:39
  • Made an edit which hopefully clarifies a bit – ok34332 Mar 24 '20 at 16:46

0 Answers0