Monday 26 August 2013

Word wrap function in Javascript

Word wrap function in Javascript

I am trying to write a Javascript function which takes a 1, 2 or 3 word
phrase and returns the same phrase, but the first found space is replaced
with a

so
Hello My World
becomes
Hello<br>My World
or
Hello World
becomes
Hello<br>World.
Ideas?

No comments:

Post a Comment