Monday, April 28, 2014

How can I read the line break from a value with Javascript and replace all the line breaks with br tags?

Example:

A variable passed from PHP as below:

"This is man.

Man like dog.
Man like to drink.

Man is the king."
I would like my result to look something like this after the Javascript converts it:

No comments:

Post a Comment