0

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?

monda
  • 3,809
  • 15
  • 60
  • 84

1 Answers1

2
<script>
var messagetoSend = document.getElementById('x').value.replace(/\n/g, "<br />");
alert(messagetoSend);
</script>

X is the table name.

Monika
  • 2,172
  • 15
  • 24