רק אל תשכחו לתת id counter
<script>
let counts=setInterval(updated);
let upto=0;
function updated(){
var count= document.getElementById("counter");
count.innerHTML=++upto;
if(upto===1000)
{
clearInterval(counts);
}
}
</script>
Code language: JavaScript (javascript)