怎么让一个计时器可以不停地暂停和开始呢
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>计时器</title>
<script type="text/javascript">
function clock(){
var time=new Date();
var atime=time.getHours()+":"+time.getMinutes()+":"+time.getSeconds();
document.getElementById("cloc").value = atime;
}
var aa=setInterval("clock()",2000);
</script>
</head>
<body>
<form>
<input type="text" id="cloc" size="50" />
<input type="button" value="Stop" onclick="clearInterval(aa)" />
<input type="button" value="start" onclick="clock()" />
</form>
</body>
</html>
这个计时器只能暂停一次,再点开始就没有了计时器的功能了