<html>
<body>
<script type="text/javascript" language="javascript">
function renderTime() {
var currentTime = new Date();
var h = currentTime.getHours();
var m = currentTime.getMinutes();
var s = currentTime.getSeconds();
if (h < 10)
{ h = "0" + h;
}
if (m < 10)
{ m = "0" + m;
}
if (s < 10)
{ s = "0" + s;
}
myClock.textContent = h + ":" + m + ":" + s;
myClock.intterText = h + ":" + m + ":" + s;
setTimeout ('renderTime()',1000);
}
renderTime();
</script>
</body>
</html>
이 코드는 현재 실행중인 디지털 24 시간 시계를 얻으려고하고 있는데, 코드를 추적하고 모든 코드를 검색했지만 코드가 작동하지 않습니다. 내가 뭘 잘못 했니?자바 스크립트가 작동하지 않는 디지털 현재 시계가
는'myClock'는 정의되지 않은 것으로 보인다. –
당신은'intText'가 아닌'innerText'를 의미했을 것입니다. – phantom