var str = $("#mydiv").html();
var regex = /<brs*[/]?>/gi;
$("#mydiv").html(str.replace(regex, "
"));
let multilineString = `My
text
1
2
3
4
is
here`;
let htmlText = multilineString.replace(/(
|
|
|
)/g, '<br>');
console.log('Multiline string: ' + multilineString);
console.log('HTML text: ' + htmlText);