Dear all,

I came across the following problem.

I'm switching formatted text (programming code) between a pre and a text area, programmatically using jQuery. Since I'm using a syntax highlighter on the pre, I'm also putting a copy of the code in an invisible div to use it as a temporary store before moving the code back undistorted to the textarea.

<pre> </pre>
<textarea> </textarea>
<div style="display:none"></div>
It works beautifully everywhere except on any version of IE. Transferring the text out of the div (using .html() on jQuery) removes all sorts of formatting from IE. Any ideas or workarounds you know about are appreciated.

I feel that some sort of escaping is involved but don't know how or why.