I have a textarea and dynamically on keydown i wanna know if there are any line breaks or not. I AM putting the value of textarea on keyup inside a div. But if someone gives a carriage return in textarea . There are no line breaks in div. How can i possibly get the breaks?
Asked
Active
Viewed 957 times
1 Answers
6
More people need to know about this:
<div style="white-space:pre-wrap">
SPAAAAAAAAAAAAAAAAAAAAAAAAAAAACE!
</div>

Niet the Dark Absol
- 320,036
- 81
- 464
- 592
-
Of all the solutions, this was the only one that worked for me. You saved my day!! – Spectrum Jul 09 '18 at 14:28