Hello
I am facing the following problem: I have a HTML document where I want to print basic status/debug/etc messages.
So, the HTML document contains an empty pre-element whose id is out:
<body onload='init () && main();'>
<pre id='out'>
</pre>
</body>
</html>
The init() function assigns the pre element to a variable:
var out_div;
function init() {
out_div = document.getElementById('out')
return 1;
}
Then, in order to print something into the pre-div, I use this function:
function txt_out(txt) {
out_div.innerHTML += "\n" + txt
}
The newline should make sure that each invocation of txt_out is written on its own line. This works as expected in Firefox. IE however doesn't seem to pay attention to the \n. So, is this wrong on IE's part, or am I doing something wrong?