<body>
<input type="text" name="display">
<input type="button" value="stop" onclick="stop()">
</body>
<script language="javascript">
var timeout1 = null;
function displayFresh()
{
var aaa = Math.random();
display.value = aaa;
timeout1 = setTimeout("displayFresh()", 1000);
}
function stop()
{
clearTimeout(timeout1);
}
displayFresh();
</script>
Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1302525