Count to ten example not working


#1


My code does not show the numbers 1 to 10


<!DOCTYPE html>
<html>
<head>
	<title>Hello, HTML!</title>
	<script>
		function countToTen() {
		var count = 0;
		while (count < 10) {
		count++;
		document.getElementById("theCount").innerHTML+=
		count + "<br>";
			}
		}
		Code-Line Before Listing Code </script>
		</head>
		<body onload = "countToTen();">
		<h1>Let's Count to 10 with JavaScript!</h1>
		<p id="theCount"> </p>
		</body>
		</html>


#2

Remove this line
Code-Line Before Listing Code


#3

It works now, Thanks!


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.