I have a javascript code like this for auto clicking submit button after 2 hours.
<script>
setTimeout(function() { //calls click event after a certain time
$('.submit-button').click();
}, 1442628010000);
</script>
But the problem is the button is clicked immedialy after page is load :(
But when i do for 10 sec it works :(
<script>
setTimeout(function() { //calls click event after a certain time
$('.submit-button').click();
}, 10000);
</script>
I even tried like this but not working
<script>
setTimeout(function() { //calls click event after a certain time
$('.submit-button').click();
}, 2*60*60*1000); //2h
</script>
Now what should i do to click the button if settimeout is not working?