Site Overlay

How to call a function in every specific time period using javascript

This is an example of calling the function after every 3 seconds in javascript.

This method is used to call a function again and again at the specific time given by us.

JavaScript

<script>
function callaFunctionAfter3Seconds(){
	alert("Hello, I am called after 3 seconds!")
}
setInterval(callaFunctionAfter3Seconds, 3000);
</script>

Open a popup after 3 seconds