Search code examples
javascriptgoogle-chromeconsole

script - click button every x seconds


I want a script that clicks on this button every 3 seconds

<input type="submit" name="Submit" value="Puxar Alavanca">

It dsnt have any class, can you guys help me?


Solution

  • you can use jQuery to trigger a click event'

    setInterval(function(){
       $( "input" ).trigger("click");
    },random(3000,4000));
    
    function random(min,max){
       return min + (max - min) * Math.random()
    }