Click here to Skip to main content
15,899,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using visual studio 2008.
I want Java script code for clicking a button repeatedly for every 5 seconds.
Can any one please guide me on this!!!
Posted

You can use setTimeout("funct()", 5000);

where funct is the function that get your button object and calls btn.click() on it.
 
Share this answer
 
Comments
Anderson8055 2-Apr-12 5:59am    
Can you give me the exact code for this
Isn't that obvious: only mouse really click on a control? What you really need is probably different: you need to call the same function which you would call from the click handler. This is exactly what you could do.

You can also use timing events. Please see the documentation with code samples:
http://www.w3schools.com/js/js_timing.asp[^].

—SA
 
Share this answer
 
Comments
Monjurul Habib 30-Mar-12 4:51am    
5!
Sergey Alexandrovich Kryukov 30-Mar-12 11:15am    
Thank you, Monjurul.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900