Posted By

iloveitaly on 05/26/09


Tagged

html character new line break br newline literal


Versions (?)

nl2br: New Character to HTML Break


 / Published in: JavaScript
 

  1. function nl2br(str) { return str.replace(/\n/g, '<br />'); }

Report this snippet  

You need to login to post a comment.