I'm trying to create a simple counter website using HTML, CSS and JS (Hypertext Markup Language, Cascading Stylesheets and JavaScript). I use this HTML code: jswebsite.html
<!DOCTYPE html>
<html>
<head>
<title>JS Website</title>
<meta charset="utf-8">
<link rel="stylesheet" href="styles3.css">
<link rel="script" href="script1.js">
</head>
<body>
<h1>Counter</h1>
<p id="counter"></p>
</body>
</html>
This CSS code: styles3.css
body {
background-color: rgb(255, 169, 0);
}
h1, p {
text-align: center;
color: rgb(255, 69, 0);
background-color: rgb(148, 43, 226);
margin-left: auto;
margin-right: auto;
}
And this JS code: script1.js
var number = 0;
var i = 0;
while (i < 1) {
document.getElementById("counter").innerHTML = number;
number++;
}
Instead of giving me a counter, it just shows the heading and give me no other text.
Am I doing anything wrong?
Nothing to see on the expansion.