JSFiddle - React, Tailwind, and code Playground

HTML

<textarea id="inputtext" style="height:100px"></textarea>
<button id="show">show in div</button>
<div id="showtext">
    
</div>

CSS

#showtext {
    white-space: pre-wrap;
}

JavaScript

$(function(){
    $('#show').on('click',function(){
        var text = $.trim($('#inputtext').val());
        $('#showtext').text(text);
    });
});