I have to display an article from database inside a < div> tag. This article was inserted into database from a textarea. My problem is: i could not display exactly the structure that i inserted from the textarea (including line break)
I tried the below code to replace the enter character to < br> tag but it did not work
<div id="tmpId">${f:h(dto.accPassage)}</div>
<script>
$(function(){
$('#tmpId').html($('#tmpId').html().replace(/\n/g, '<br />'));
})
</script>
I wonder if someone could give me some hints to solve this problem.
Thank you very much.