I have a div with attr("contentEditable",true)
. The problem if I enter text
111111111111
2222222222222222
33333333333333333
It simply take 1111111111111111112222222222222222222233333333333
I am taking div text using $.text()
I have a div with attr("contentEditable",true)
. The problem if I enter text
111111111111
2222222222222222
33333333333333333
It simply take 1111111111111111112222222222222222222233333333333
I am taking div text using $.text()
Because \n
is not a newline character to web browsers. Web browsers ignore whitespace. If you want to display a new line you must add a <br>
wherever you see a new line character.