문제

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?

도움이 되었습니까?

해결책

More people need to know about this:

<div style="white-space:pre-wrap">


                            SPAAAAAAAAAAAAAAAAAAAAAAAAAAAACE!

</div>

Demo

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top