<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>