I am breaking a string in javascript using \ n, for example: -
text = "this is a test" + "\ n" + "another test";
and show that in html i m using code
text = text.replace('\n' , '<br>');
but text i m gets without br
when checking in firebug console I get line breaks (\ n is not displayed except for a new line)
how can I place line breaks using \ n or should I do some kind of custom code instead of \ n
thank
source
share