I think that will only replace the first one. To replace all of them, you
need /\n/g like Pops suggested.

--Erik


On 9/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> There is no such jQuery function.
> Fortunately, JavaScript the language itself provides use with
> String.replace().
>
> Use like this:
>
> var multiline_string = "Hello\nWorld\n!\n";
> multiline_string = multiline_string.replace("\n", "<br>");
> alert(multiline_string);
> // output: Hello<br>World<br>!<br>
>
> HTH,
> Rick
>
>
> On Sep 18, 6:03 pm, Mike Miller <[EMAIL PROTECTED]> wrote:
> > Are there any jquery functions that can take a text value and convert
> > any newlines to <br> tags?
>
>

Reply via email to