a = "it popularised<br> in 1960s with<br> release of letraset sheets containing lorem ipsum passages, , more desktop publishing software aldus pagemaker including versions of lorem ipsum.";
a.replace(/\n|\t/g,'<br>');
all br tags need replace \n\t
not working .
use below code:
var myregex = /<br\s*[\/]?>/gi; alert(a.replace(myregex, "\n\t"));
this should replace every <br>
tag \n\t
. see jsfiddle
Comments
Post a Comment