Why does my code not work

javascript
html

#1

this code is both js and html

<html>
  <head>
    </head>
      <body>
 <p id="a"></p>     
<script>
var second = function(){
var a = Date().charAt(22);
var b = Date().charAt(23);
var n = a+""+b
return n
}
document.getElementById("a").innerHTML = second();
var waitseconds = function(seconds){
for(var i = 1; i < seconds+1; i++){
var s = second();
while(s = second();){
//waiting until second() == second()+1
				}
		}
}
for(var i = 1; i <101; i++){
waitseconds(1);
document.getElementById("a").innerHTML = i;
}

</script
  </body>
</html>

i was attempting to make a waitseconds function, i correctly was able to take the amount of seconds from the Date() method but for some reason waitseconds(){} doesnt work? why!


#2

Why are you making your own? Try looking here:


#3

i dont know what any of that means, i just want a line of code that waits a certain amount of ms


#4

A conditional expression requires a comparison, === or ==, and there is no semi-colon permitted inside the ().