In IE when I insert text into a <pre>
tag the newlines are ignored:
<pre id="putItHere"></pre>
<script>
function putText() {
document.getElementById("putItHere").innerHTML = "first line
second line";
}
</script>
Using
instead of a plain
does not work.
<br/>
does work but inserts an extra blank line in FF, which is not acceptable for my purposes.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…