<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>javascrip</title>
</head>
<body >
<script>
function show() {
console.log('每过1秒展示');
}
function show2(str) {
console.log(str);
}
function showTime()
{
time = new Date();
hour = time.getHours();
minu = time.getMinutes();
sec = time.getSeconds();
datetime = hour + ":" + minu + ":" + sec
document.getElementById('checkvalue').value = datetime
}
var she;
she = setInterval(showTime, 1000);
clearInterval(she);
//setInterval(show2, 2000, '每过2秒展示');
</script>
<input type="button" id="checkvalue" />
</form>
</body>
</html>