The problem is this, when breaking the line in textarea
in div .result
where it is supposed to appear the result of what is typed in textarea
, it only gives a space and does not break the line.
How do I break the line when one jumps the same in textarea
Here is my code below:
$('.text').keyup(function(e) {
$('span.result').html( $('.text').val() );
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><textareaname="" class='text' placeholder='texto'></textarea>
<br/>
<span class='result'>texto</span>