I have a problem with executing a set timeout on a function in HTML
I will show you 2 examples one that works the other simply ignore the set timeout method
Working example :
A: onclick="setTimeout(hideBtn, 1000)"
in this example the hidenBtn does not have and index() attached to it and the 1sec delay simply works.
Problematic example :
B: onclick="setTimeout(hideBtn(0), 1000)"
in this example once I define and array index after the function the set time get ignored and the function executes right on click.
do you see any problem with the syntax ?
I will link the whole function from the JS file because I tried to set the set Time out from there but and error occur saying the whole function is not defined ?
since I need the index to be defined I cannot go with working example.
thanks for help.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…