Click error in the Chrome's Developer Tools console.
I've tried some solutions from here, but they don't seem to work in the Dev Tools. Probably they're only for web pages.
var inputs = document.querySelectorAll('button.class');
for (var i = 0; i < inputs.length; i++) {
setInterval(function() {inputs[i].click()}, 2000);
}
What I'm waiting to happen is for the script to click all the class='class'
buttons on (any) web page, one by one, starting with the first one found. What happens is nothing and the following error is displayed in the console:
Uncaught TypeError: Cannot read property 'click' of undefined.
Eugene provided the solution, see below for the scenario when the button has multiple class. PS this was not a duplicate.