javascript replace newline with br

75

javascript replace <br> with n -

var str = $("#mydiv").html();
var regex = /&lt;br\s*[\/]?&gt;/gi;
$("#mydiv").html(str.replace(regex, "\n"));

Comments

Submit
0 Comments