JSFiddle - React, Tailwind, and code Playground
HTML
<textarea type='text' name="textarea" id='textarea'> </textarea><br/>
<span id="display"></span>
JavaScript
$(document).ready(function() {
$('#textarea').keypress(function(e) {
var display = $('#textarea').val();
if (e.shiftKey === true) {
if (e.which == 13) {
//append a break
$('#textarea').append("<br/>");
}
} else {
if (e.which == 13) {
// submit to form using submit()
$('span#display').html(display);
}
}
});
});