JavaScript Reference/Javascript Methods/clearTimeout

Материал из Web эксперт
Перейти к: навигация, поиск

"clearTimeout()" Example

    
<html>
<body>
<script language="javascript">
    var intValue = 0
    function myMethod(){
        alert("timeout");
    }
</script>
<button onclick="intValue=window.setTimeout("myMethod()", 1000);">Start timeout</button>
<button onclick="intValue=window.clearTimeout(intValue);">Stop timeout</button>
</body>
</html>



"clearTimeout()" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |window                                                        |
+----------------+--------------------------------------------------------------+



"clearTimeout()" Syntax, Parameters and Note

Note:
Removes a timeout initialized by the setTimeout() method. 
    
Syntax:
    
window.clearTimeout(param1)

Parameters:
    param1   Required; the numeric timeout ID previously returned by the 
                       window.setTimeout() method.