I am submitting textarea using ajax and when I append the response to a class it shows the dummy only when if there is no new line in text area .
HTML
<p id="updateres_n"></p>
<div class="update_res"></div>
ajax code
success: function(response){
document.getElementById('upd_msg').innerHTML="updated";
$('.update_res').append(response);
}
php code
First inserts textarea and print_r
new updated text in javascript
<script>
document.getElementById('updateres_n').innerHTML="<?php print_r (nl2br($updated_text));?>";
</script>