I have created a multiline string as follows"
var str1 = document.getElementById('text1'); var str2 = document.getElementById('text2'); var str = str1.value + "\n" + str2.value;
I now want to add this string to a div that I create in a popup window as follows:
myWindow=window.open('','Full_text','width=600,height=600'); myWindow.document.write('<div id="div1" style="position: absolute; left: 10px; width: 580px; top: 30px; height: 550px; overflow: auto;">' + str + '</div>');
But I do not get a multiline string in the div. How do I solve this problem?