I am working on trying to get a way for whatever is in a textarea to move over to a div on a button click. Some of the key features that i am looking for is that i want linebreaks to stay and that if a user inputs any kind of html tags, it will cross over shown the same way.
So something like this that is entered:
<body>
<p>blah blah blah</p>
<p>more text</p>
</body>
will still look the same in the div area.
I have tried a couple of things, but most recently I have tried this:
var value = $('#selector-input textarea').val().replace(/\n/g, '<br/>');
$('#selector-canvas #canvas').text(value);
Does anyone have any ideas? Any help would be much appreciated. Thanks!