Why does my code not work

this code is both js and html

 <p id="a"></p>     
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++){
document.getElementById("a").innerHTML = i;


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!

Why are you making your own? Try looking here:


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

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