I am trying to make new lines (in this single line of text) as you can see in my index.html file, but it is not working, any help? (\n is where the new line should start,
has not worked either.
index.html:
<html>
<head>
<title>test</title>
</head>
<body bgcolor="black">
<font color="green">
<p id="terminal"></p>
<script>
var text = "this is a test\nthis should be on the next line";
var count = 0;
var speed = 50;
function Type() {
if(count < text.length) {
document.getElementById("terminal").innerHTML += text.charAt(count);
count ++;
setTimeout(Type, speed);
}
}
Type();
</script>
<br>instead\ninnerHTMLof an item. You can use<pre>to keep the white space inside of it's tag instead of<p>.