How to make it so that you can press several times one and the same button in a row?

I tried it with a delay of two seconds - nothing happened:

if ($('#double_your_btc_bet_lose').html() !== '' && multiplier == 3 ) { multiplier++; $('#double_your_btc_2x').click(); function firstStep() {} function secondStep() {} firstStep(); setTimeout('secondStep()', 2000); $('#double_your_btc_2x').click(); } 
  • four
    First press the button for the first time, then press it a second time - tCode
  • if ($ ('# double_your_btc_bet_lose'). html ()! == '' && multiplier == 3) {multiplier ++; $ ('# double_your_btc_2x'). click (); function firstStep () {} function secondStep () {} firstStep (); setTimeout ('secondStep ()', 2000); $ ('# double_your_btc_2x'). click (); tried so - Glory Nov.
  • with a delay of two seconds - nothing happened - Glory
  • Please edit your question. No need to write code in the comments. - u_mulder

3 answers 3

 for (var i = 0 i < 100; i++) { // Π½Π°ΠΆΠΈΠΌΠ°Π΅ΠΌ 100 Ρ€Π°Π· подряд Π½Π° ΠΊΠ½ΠΎΠΏΠΊΡƒ $('#button').click(); } 
     function(){for (var i = 0; i < 2; i++) {$('#button').click();}}; 
    • var i = 0 i <2; i ++ in this expression is unnecessary to put a comma before i <2? - Glory

     function click(e, n, t) { if(e != undefined && n != undefined && n > 0 && t >= 100){ var m = 0; var int = setInterval(function() { if(m == n){ clearInterval(int); }else{ m++; $(e).click(); }; }, t); }; }; $(function() { $('button').click(function() { console.log('НаТали!'); }); click('button', 5, 2000) }); 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button>НаТми на мСня</button>