You are here: Reference > JavaScript > client-side > HTML DOM > methods > clearTimeout (window)

clearTimeout method (window)

Browser support:
Clears the delayed action that was previously set by the setTimeout method.
If the action was registered with the setInterval method, use the clearInterval method to remove it.


object.clearTimeout (timeoutID);
You can find the related objects in the Supported by objects section below.


Required. Integer that specifies the identifier of the timer returned by the setTimeout method.

Return value:

This method has no return value.

Example HTML code 1:

This example illustrates the use of the clearTimeout method:
    <script type="text/javascript">
        var idx = 0;
        function SetDelay () {
            delayTime = setTimeout ("Counter ()",200);
        function Counter () {
            document.getElementById ("textAr").innerHTML += idx;
            if (idx>9) {
                clearTimeout (delayTime);
    <button onclick="SetDelay ();">Click to count!</button>
    <textarea id="textAr"></textarea>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content