http://jsfiddle.net/hD8CF/10/ puts the <pre>
tag into the equation.
The key line change is here:
$("#id_output").html("<pre>" + val + "</pre>");
Another comment mentions adding <pre></pre>
to the HTML and targeting that for the output.
You can see a working draft of that on jquery: http://jsfiddle.net/fqX8c/. Please like his comment, above. Also, I have code that sends the text as an object, on defocus, which is useful in other ways; unfortunately for me, it uses knockback, and I use jQuery and mooTools. I'll be trying to translate it to jQuery. http://jsfiddle.net/hD8CF/18/, working version: http://jsfiddle.net/hD8CF/20/: educational version