L
laredotornado
Hi,
I'm using the JQuery framework but this question is about the string
replace method. I'm trying to replace carriage returns "\n" with the
"<BR/>" tag. Sadly, the replace method I have below is not
working ...
$('.replaceLineBreaks').each(function() {
console.log("replacing " + $(this).html());
$(this).html( $(this).html().replace('/\\n/g', '<BR/>') );
});
Any ideas how to fix it? Thanks, - Dave
I'm using the JQuery framework but this question is about the string
replace method. I'm trying to replace carriage returns "\n" with the
"<BR/>" tag. Sadly, the replace method I have below is not
working ...
$('.replaceLineBreaks').each(function() {
console.log("replacing " + $(this).html());
$(this).html( $(this).html().replace('/\\n/g', '<BR/>') );
});
Any ideas how to fix it? Thanks, - Dave