I am newbie with javascript and I wrote a very simple program to test a while loop. My problem is, I do not know how to do line break with my code. Here is my code
<!DOCTYPE html>
<html lang="en">
<head>
<title>Phrase-o-matic</title>
</head>
<script type="text/javascript">
var scores = [60, 50, 53, 55, 61, 51, 44];
var output;
var i = 0;
while (i < scores.length) {
output = "Bubble solution #" + i + " score: " + scores[i] ;
document.write(output);
i = i + 1;
}
</script>
<body>
</body>
</html>
As you can see, very simple. But, when I ran my code, it was no line break. It was very ugly. Could you please give me some ideas to repair it or more? Thank you very much.
` element to output a line break in HTML. Or put the text into a ` – evolutionxbox Jun 09 '21 at 12:00
');` – Hassan Imam Jun 09 '21 at 12:00