JavaScript Program to Demonstrate the Use of setTimeout() method

Write a JavaScript program to demonstrate the use of settimeout() method.



Source Code
<html>
<head>
    <title>setTimeout() method</title>
    <script>
        function greeting()
        {
            alert('Hey, Good Morning')
        }
    </script>
</head>
<body onload="setTimeout('greeting()', 5000);">
</body>
</html>
Output