Execute the function automatically in 30 seconds, if the button is not pressed
- by You Kuper
I want to add the following functionality to my web page: if a user has not pressed the 'Accept' button during 30 seconds, then $('#popupBoxAccept').click( function() {..} is executed automatically.
$(document).ready(function() {
loadPopupBox();
});
function loadPopupBox() { // to load the Popupbox
$('#popup_box').fadeIn("slow");
}
$('#popupBoxAccept').click( function() {
//...
});
$('#popupBoxDecline').click( function() {
//...
});
<div id="popup_box">
<a id="popupBoxAccept">Accept</a>
<a id="popupBoxDecline">Decline</a>
</div>