CSDN - 专家门诊 - Javascript问题  
 回复 | 推荐 | 收藏 | 专题 | 公告 | 管理 | 关闭窗口  
 
 
 
主  题:  如何取消定时触发? 
作  者:  simonqsm ()  
等  级:    
信 誉 值:  100 
所属论坛:  Javascript 
问题点数:  20 
回复次数:  0 
发表时间:  2002-3-6  10:08:59 
   
要该一下程序 
<script  language="javascript"> 
var tempId;
function  test(){ 
alert("定时警告!!") 
tempId = setTimeout("test()",1000) 

test() function stoptime(){
  clearTimeout(tempId);
}
</script>  
<input type=button onclick="stoptime()" value="停止">