After 5 seconds, I need to simulate a click on a button.
var count = 5;
countdown = setInterval(function () {
$("#count").html(count);
if (count == 0) {
alert("Jotain pitäis tapahtua. kai");
//What should I put instead of this line?
}
count--;
}, 1000);
return false;
Is it even possible?
You can do
This triggerses all the event handlers for click event that have been added to the button.Event handlers must have been added by the same instance of jQuery that triggers the click event ( be careful if you have more than one instance of jQuery )
if you want to trigger some namespaced effect use