function text_window()
{
var xmlDoc;
if (window.XMLHttpRequest)
{
xmlDoc=new window.XMLHttpRequest();
xmlDoc.open("GET","cd_catalog.xml",false);
xmlDoc.send("");
xmlDoc=xmlDoc.responseXML;
}
// IE 5 and IE 6
else if (ActiveXObject("Microsoft.XMLDOM"))
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("cd_catalog.xml");
}
document.write("<textarea rows=\"10\" cols=\"90\" ID=\"Textarea1\" NAME=\"Textarea1\" readonly=\"readonly\">");
var x=xmlDoc.getElementsByTagName("CD");
for (i=0;i<x.length;i++)
{
document.write(x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue);
//How do I put a line break here?
document.write(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue);
}
document.write("</textarea>");
}
I would like to edit the scrolling textarea where I wrote the comment "//How do I put a line break here?"
Currently, it prints all on the same row/line.
Output:
Bob Dylan" "Empire BurlesqueBonnie TylerUKHide your heartDolly PartonUSAGreatest HitsGary MooreUKStill got the bluesEros.......
Desired Output:
Bob Dylan Empire
BurlesqueBonnie Tyler Hide your heart
Dolly Parton Greatest Hits
Gary Moore Still got the bluesEros.......
etc.