Arthur  Kohansky Arthur Kohansky - 5 months ago 22
Javascript Question

Textarea preview

I have a problem regarding

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

enter image description here

EDIT :

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

enter image description here

Answer

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>
Comments