javascript close page after 5 seconds

Code Example - javascript close page after 5 seconds

                
                        <html>
<head>
</head>
<body onload="waitFiveSec()"> <!--it will wait to load-->

<!-- your html... -->
<script>
  function waitFiveSec(){
   var milliseconds = 5 * 1000;
            setTimeout(function(){
                window.close();
            }, milliseconds);
  }
</script>

</body>
</html>