How can I read the line break from a value with JavaScript and replace all the line breaks with elements?
Example:
A variable passe
If the accepted answer isn't working right for you then you might try.
str.replace(new RegExp('\n','g'), '')
It worked for me.