Created
October 11, 2009 14:34
-
-
Save ritou/207699 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html;charset=utf-8"> | |
<title>2 Minute Speech</title> | |
<script type="text/javascript"><!-- | |
var time=120; | |
var sectimer; | |
//window.onload = function() { | |
function startSpeech() { | |
sectimer=setInterval("countdown()",1000); | |
} | |
function countdown() { | |
time--; | |
document.getElementById("button").innerHTML = ""; | |
if( time < 1 ){ | |
document.getElementById("countdown").innerHTML = "【終了】お疲れさまでした。"; | |
clearInterval(sectimer); | |
}else{ | |
document.getElementById("countdown").innerHTML = "残り "+time+" 秒"; | |
} | |
} | |
function message(str) { | |
document.getElementById("countdown").innerHTML = str; | |
} | |
// --></script> | |
</head> | |
<body> | |
<h1><div id="countdown">【2 Minute Speech】</div></h1> | |
<div id="button"><input type="button" value="Start" name="myFormButton" | |
onclick="startSpeech()"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment