In my page one of the table column has the html like below
My world Logistics,\n Hamburg Industriestrasse \n 21107 Megas Sorter HH India
wherever there is \n i need to replace it withe html tag <br>
How can do it in Jquery, javascript?
In my page one of the table column has the html like below
My world Logistics,\n Hamburg Industriestrasse \n 21107 Megas Sorter HH India
wherever there is \n i need to replace it withe html tag <br>
How can do it in Jquery, javascript?
<script>
var messagetoSend = document.getElementById('x').value.replace(/\n/g, "<br />");
alert(messagetoSend);
</script>
X is the table name.
with newline character "\n"](http://stackoverflow.com/questions/8062399/how-replace-html-br-with-newline-character-n) – nkmol Nov 22 '13 at 11:12