Skip to content

Instantly share code, notes, and snippets.

@ritou
Created October 11, 2009 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ritou/207699 to your computer and use it in GitHub Desktop.
Save ritou/207699 to your computer and use it in GitHub Desktop.
<!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