Garbonzo_Horowitz
asked on
Adding a space to a carriage return line feed in JQuery
Hello experts. I would like to know how to add a space to every Line Space Carriage Return with JQuery.
I have two textarea boxes. I want to take the contents of the original one and add a space to every CR LF into the second one.
This is what I have so far but it's not working correctly:
Any guidance is appreciated.
I have two textarea boxes. I want to take the contents of the original one and add a space to every CR LF into the second one.
This is what I have so far but it's not working correctly:
var original = $("#myTextbox").val();
var fixed = original.replace( /[\r\n]+/gm, \n+" " );
$('#myTextbox2').val(fixed);
Any guidance is appreciated.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER