jquery :Find the new line character and replace it with <br>

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?


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

X is the table name.

Need Your Help

java.lang.NullPointerException: the servlet is never executed?

java jsp maven tomcat servlets

I'm learning how to do a maven dynamic web application with Eclipse and Tomcat. The applicacion works without servlet, but I get that error when I try to introduce it in my code. I debugged to find...

How to add a the share 'menu' like this?

iphone facebook twitter social

Does any of you guys know what this 'menu/view' is called and how to implement this?