jsカウントダウン機能
992 ワード
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
function $(id){
return document.getElementById(id);
}
var time = 12*60*60+2;
function changeTime(){
time = time-1;
var hours = Math.floor(time/(60*60));
var minitus = Math.floor(time/60%60);
var seconds =Math.floor(time%60%60);
$('time').innerHTML = hours+':'+minitus+':'+seconds;
}
setInterval('changeTime()',1000);
</script>
</head>
<body>
<div style='font-size:111px' id='time'></div>
</body>