Hello there,
I have writted a text in a textarea called $text.
I want to insert it into a var in javascript. The problem it, that if I make a newline, will the javascript look like this:
var text = 'line1
line2'
that javascript cannot understand. I want it to be like this:
var text = 'line1<br>line2'
I cannot just use nl2br(), because it doesn't replace the newline, it just insert the <br>. How do I remove the newline?
Thanks!