I am using the \n in the sProfile1 string variable but it does not work. Can someone help me with this ? Thanks. var sProfile1 = "test\nstring"; function showPic (whichpic) { if (document.getElementById) { document.getElementById('placeholder').src = whichpic.href; if (whichpic.title) { if (whichpic.id==1) { document.getElementById('desc').childNodes[0].nodeValue = sProfile1; } } } }
Please use the code tags when posting code. It's the # on the toolbar. Use "<br>" and innerHTML: varsProfile1 = "test<br>string"; document.getElementById('desc').innerHTML = Profile1; Code (markup):