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?

3

1 Answer 1

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

X is the table name.

Sign up to request clarification or add additional context in comments.

1 Comment

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.