<html>
<body>
<p>A window will be appeared after five seconds once you click this button.</p>
<button οnclick="myFunc()">button</button>
<script type="text/javascript">
function myFunc(){
setTimeout("alert('after five seconds')",5000);
}
</script>
</body>
</html>
The function setTimeout() is used to call functions or execute expressions after a specified number of milliseconds.And the code in the function will execute only once.