I have this function, which I would like to be executed after 5 seconds:
$(document).ready(function() {
$("#signInButton").trigger('click');
});
Thank you
I have this function, which I would like to be executed after 5 seconds:
$(document).ready(function() {
$("#signInButton").trigger('click');
});
Thank you
Use setTimeout()
function:
$(document).ready(function() {
setTimeout(function() {
$("#signInButton").trigger('click');
}, 5000);
});
Use setTimeout()
$(document).ready(function() {
setTimeout(function() {
$("#signInButton").trigger('click');
}, 5000); // for 5 second delay
});
$(document).ready(function() {
setTimeout(function() {
$("#signInButton").trigger('click');
}, 5000);
});
Something like this ?
$(document).ready(function() {
setTimeout(function() {
$("#signInButton").trigger('click');
}, 5000);
$("#signInButton").click(function(){
alert("I'm clicked!");
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="button" id="signInButton" value="Click Me" />
Learn more about window's setTimeOut method