I have a button that gets triggered by the click of another button. I want to delay click of the second button for two seconds. I used .delay() but it didn't work.
jq(function() {
jq('a.box').click(function() {
jq(this).closest('.button').find('.add_this').delay(2000).click();
})
});
or Using setTimeout;
jq(function() {
jq('a.box').click(function() {
setTimeout(function(){
jq(this).closest('.button').find('.add_this').click();
},800);
});
});
But didn't work.