View Single Post
Old 02-01-2013, 10:38 PM   PM User | #5
ten3six
New Coder

 
Join Date: Jan 2011
Location: fort worth, tx
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
ten3six is an unknown quantity at this point
Quote:
Originally Posted by Airblader View Post
Actually you can use \r\n (both needed for Windows). But why are you surprised it shows up as '\n' if you escape it to '\\n'?

Code:
document.getElementById('myTextarea').value = 'Hi!\r\nThis is a new line';
That works just fine ( http://jsfiddle.net/N6fNB/ )
I wasn't surprised. I knew that would happen. I also wasn't surprised that "<br>" showed up but in all of my searching for a solution those were more often then not suggested. I just wanted to show that it DIDN'T work to avoid getting those answers.
ten3six is offline   Reply With Quote