I have the following code:
var play = function() {
$(steps).each(function(i, e) {
$(this).is(':visible')
? $(this).click()
: console.log($(this).html() + ': not visible');
});
};
The problem with this code is that it immediately clicks on an element if it is visible. However, I would like to wait / poll for an item that will be present for up to N seconds before clicking on the item. Any suggestions on how I can implement this? Thank!
source
share