I'm trying to click every item with a 200 millisecond interval, I wrote the following script however there seems to be an issue with the For Loop. Some one please tell me what you think is wrong with it.
function clickLink(elm) {
var evt = document.createEvent('MouseEvents');
evt.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
elm.dispatchEvent(evt);
}
function sel() {
elms = document.getElementsByClassName('uItem');
var inputs= elms;
var howbig= elms.length;
console.log(howbig);
for (var i=250;i<elms.length;i++)
{
setTimeout(clickLink(inputs[i]),200)
};
There's 1400 uItem 's on the page.