How To Replace All Line Breaks With <br /> Using JavaScript

1 |
yourUpdatedVar = yourOriginalVar.replace(/\n/g, '<br />'); |
1 |
yourUpdatedVar = yourOriginalVar.replace(/\n/g, '<br />'); |
Categories: How-To's, Technology Tags: howto, javascript, line break, Newline, Replace, Search and Replace, tips
Copyright © 2005-2025 Eric Michael Stone | Random Thoughts, Whims and Fancies…. Powered by WordPress
Leave Your Comment
All fields marked with "*" are required.