Dan
Dan

Reputation: 3469

IE7 stripping newlines when placing info from a DIV into a TEXTAREA

I'm trying to fetch HTML/Text from a DIV and place it as-is (newlines and all) in a textarea. Seems simple enough, however IE7 is deciding to strip the newlines.

Here is my fiddle http://jsfiddle.net/qU29k/1/ - it should work correct on other browsers but IE7 will place all the text on a single line. This happens when using both .html() and .text(). I've also tried replacing \n's with \r\n's as per: .html() wont show newlines in IE but that was a no-go either.

Any ideas how this can be remedied?

Upvotes: 1

Views: 120

Answers (1)

Dan
Dan

Reputation: 3469

I resolved the issue by changing the div to a textarea.

Here is the updated fiddle: http://jsfiddle.net/qU29k/7/

Upvotes: 1

Related Questions