I’m a little confused due to when I insert a text stored in mysql in a div I use the following sentence to insert the text:
<div class="menssge_holder"><?php echo str_replace("\n", "</p>", $conversation[$i]['message']); ?></div>
That sentence works fine, but when the user enter a new message in a textarea and press send button, i put that text within the div_holder and ‘\n’ do not take effect.
What’s the equivalent I should use in javascript or jQuery?
Thanks.
In your case you need something like this:
jsBin demo