javascript set textarea value with line breaks

set textarea value with line breaks.

let replaceText = $("#replaceText").html().replace(/\n/g, '\n');
$("#textarea").val(replaceText);