Break line row in <div> tag from database
I need to display an article from a database inside a <div>. This article was inserted into the database from a text box. My problem: I was not able to accurately display the structure that I inserted from the text box (including line break)
I tried the code below to replace the input character with <br>, but that didn't work
<div id="tmpId">${f:h(dto.accPassage)}</div>
<script>
$(function(){
$('#tmpId').html($('#tmpId').html().replace(/\n/g, '<br />'));
})
</script>
I wonder if anyone can give me some clues to solve this problem.
Many thanks.
+3