I have a simple JavaScript setTimeout
function, but it is refusing to work
setTimeout(timeup(tc,chosen),10000)
... and this is the function:
timeup = function (clt,clo)
{
alert("time up")
}
... and the time up alert shows up immediately instead of after 10 seconds can someone tell me why this is happening please?
because you're actually calling the timeup(tc,chosen)
function inside the setTimeout function.
try:
setTimeout(function(){
timeup(tc,chosen);
}, 10000);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With