Monday, May 13, 2024
 Popular · Latest · Hot · Upcoming
65
rated 0 times [  70] [ 5]  / answers: 1 / hits: 58485  / 13 Years ago, wed, november 9, 2011, 12:00:00

How can I replace HTML <BR> <BR/> or <BR /> with new line character n


More From » html

 Answers
3

You're looking for an equivilent of PHP's nl2br(). This should do the job:


function br2nl(str) {
return str.replace(/<brs*/?>/mg,"n");
}

[#89227] Monday, November 7, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ramseydeshaunc

Total Points: 30
Total Questions: 91
Total Answers: 103

Location: Palau
Member since Tue, May 30, 2023
1 Year ago
;