I need to insert lot of text in DIV.. the only problem is this: document.getElementById("submit").innerHTML="Preview"; is working just fine document.getElementById("submit").innerHTML=" Text Preview text "; is not working... and i need to insert around 30 lines full of html code...
var content = "line1<br />"; content += "line2<br />"; content += "line3<br />"; ... document.getElementById("submit").innerHTML = content; PHP: you can't use whitespace in strings over new lines like you do in PHP.