0
Why do it is showing before clicking the button
8 odpowiedzi
+ 3
+ 2
Saddam Hussain
Because you are calling function on
setInterval(f,200)
call this inside another function
function fun() {
setInterval(f,200)
}
+ 2
Ipang I want to show the timer after the button is clicked . Help me please
+ 2
Saddam Hussain
Just do like that as I said and change onclick event function 'f()' to 'fun()'
+ 2
Saddam,
I thought you meant to increment counter by clicking the button, that's why I said you didn't need the setInterval()
AJ had provided you good answer in this case.
+ 1
You don't even need the setInterval() since you have set the button "onclick" attribute to invoke function f()
+ 1
A͢J will you please help me by giving the full code
+ 1
ok I am trying