+ 1
Why i cant call function setTimeout
im try call setTimeout on <button, onclick="setTimeout(next(), 10000);> but it didnt work, cant understant why. function next change imgs src.
4 Answers
+ 5
drop the () on next, otherwise it will *immediately* evaluate the output of next() -- does it return anything, or 'undefined'? -- and then attempt to start whatever that output is 10 seconds later.
+ 2
Did the question text change?
+ 1
Hi you have missed out double quote at the end of onclick
0
Did you wait 10 seconds?
Can you show the next() function()?