My Code
window.onload = function(){
setInterval(function(){
if (typeof document.getElementsByClassName('btn-primary')[0]!="undefined"){
document.getElementsByClassName('btn-primary')[0].click();
}
}, 1000);
}
<button type="button" class="btn-primary" >Auto click</button>
i want to click button
as class="btn-primary"
only 10 time. but i won't find the code for it. my code repeats clicking every 1s.
Now my question is, how can i click the button
only 10 times?