How to use Window Object SetTimeout in JavaScript

In this article I am going to explain about window object SetTimeout() Method in JavaScript.
  • 2213

JavaScript Window object SetTimeout() Method

JavaScript SetTimeout() method use for call a function after specified number of time.


Window.SetTimeout(Function(), Milisecond)

Example // In this example when you will click on the button then a message will be display after 5 second



    <script type="text/javascript">

        function TimeFun() {

            var t = setTimeout("myfun()", 5000)


        function myfun() {

            alert("Hello friends");







        When you will click on the button then a meessage<br />

        will be display after five second</p>

    <input type="button" value="click me" onclick="TimeFun()" />








You may also want to read these related articles: here
Ask Your Question 
Got a programming related question? You may want to post your question here


More Articles

© 2020 DotNetHeaven. All rights reserved.