window.clearTimeout()

JavaScript1.0+, JScript1.0+ Nav2+, IE3+, Opera3+ Syntax

							window.clearTimeout(timeout)

Description

The clearTimeout() method of the Window object clears the timeout passed to the method. The timeout that is passed has to be previously defined using the setTimeout() method.

Example

Listing 7.530 has a button and text box. By the default, the time will be displayed in the text box after five seconds. This is done using the setTimeout() method. If the button is clicked, a function is called that invokes the clearTimeout() method preventing the time from being displayed in the text box.

Listing 7.530 Using the clearTimeout() Method
 <html> <head> <script language="JavaScript"> <!-- Hide // Define a function to show the ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.