$("textarea").blur(function() {
$("div").html($("textarea").val());
});
$("textarea").blur();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<textarea style="height:50px;">
1. test
2. test
3. test
</textarea>
<div style="word-break: break-all;"></div>
I would like to make the text appear in div in the exact manner as it appears in textarea.
I've tried to css div with word-break
, etc. but none has worked.
Note: specifically, I just want to know how to do it within a div.
tags?](http://stackoverflow.com/questions/784539/how-do-i-replace-all-line-breaks-in-a-string-with-br-tags) – Nico Mar 08 '17 at 22:37