How to use Window Object ClearInterval in JavaScript

In this article I am going to explain about window object ClearInterval() method in JavaScript.
  • 2264

JavaScript Window Object ClearInterval() Method

JavaScript ClearInterval() method use for clear the current timer and set SetInterval() method. SetInterval() method is a method by which we can set specifics time interval for any action.



clearInterval(SetInterval id)




    <textarea id="mm"></textarea>

    <script type="text/javascript">

        var int = self.setInterval("Time()", 1000);

        function Time() {

            var date = new Date();

            var tme = date.toLocaleTimeString();

            document.getElementById("mm").value = tme;





    <button onclick="int=window.clearInterval(int)">

        click me</button>

        <p>click button for setInterval</p>







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.