I need to click all the submit button on a page so what I do ? in chrome console:
var sumbits = jQuery(":submit");
for(var i =0; i<sumbits.length; i++) {
sumbits[i].click();
}
but the problem is only the last link clicked. how do I achieve a solution.
Thanks
You can do this
$("input[type='submit']").each(function(){
$(this).trigger("click");
});
To trigger clicks on a delay youll have to trigger them from within a setInterval
function.
var btns = $("input[type='submit']"),i=0,l = btns.length;
function clickLoop(){
return setInterval(function(){
btns[i].trigger('click');
if(i>=l)
clearInterval(fn);
i++;
},2000);
}
var fn = clickLoop();