I'm trying to add a pause between clicks when clicking on buttons in a page.
It's giving me "Uncaught TypeError: Cannot read property 'click' of undefined"
var inputs = document.getElementsByClassName('xxxxxx');
for(var i=0;i<inputs.length;i++) {
setTimeout(function() {
inputs[i].click();
}, (1000 * i))
}
Not sure how else to approach it. If I remove the timeout, the clicks work properly.