Set Time out



Write a javascript code for setTimeout


<html>            
  <head>
    <script>
    
    function myFunction() 
    {
        setTimeout(displayFunction,5000);
    }

    function displayFunction()
    {
        alert("Time out");
    }

    </script>
  </head>
<body>
    
    <p>Click to set The Time Out</p>
    <input type="button" value="Set Time Out" onclick="myFunction();"/>

  </body>
</html>

Output: