Jhonatan Rico Jhonatan Rico - 1 year ago 76
Javascript Question

Click a different button after clicking a button

I'm trying to auto-click a button in a page, but only after I manually clicked it first, the problem is that when the page loads, immediately the button starts to click and I need that it starts to click just after I make the first click

var $button = $('#start_autobet');
var maxWait = 3000;

function autoBet(){

setTimeout(function() { autoBet();}, getRandomWait());

I don't know how to make it start just after clicking.

Answer Source

This should work for you:

$('#start_autobet').on('click', function() {
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download