Arthur  Kohansky Arthur Kohansky - 1 year ago 81
Javascript Question

Textarea preview

I have a problem regarding

and text previewing. It doesn't recognize
button as a newline character. Any ideas how to make this previewing correctly?

enter image description here


I want this text automatically change line when it's not fitting instead of h-scroll.

enter image description here

Answer Source

You can use <pre> tag while printing text from textarea it will reflect all your new lines as it is entered text in textarea

Just use <pre> before content.e.g.

<pre> Text Content From text Area</pre>