'Coding > Python 삽질기' 카테고리의 다른 글
[Python] 소인수 분해 (0) | 2020.07.10 |
---|---|
[Python] venv 사용 (0) | 2020.04.15 |
[ChoboTimer] 타이머 앱 만들기 (0) | 2020.02.29 |
[Python] 소인수 분해 (0) | 2020.07.10 |
---|---|
[Python] venv 사용 (0) | 2020.04.15 |
[ChoboTimer] 타이머 앱 만들기 (0) | 2020.02.29 |
<html>
<head>
<title> Timer </title>
<script language="JavaScript">
// 2016. 9. 28
var timerId = NaN, mTime = 0;
function startTimer() {
mTime = document.getElementById("timer").value;
timerId = setInterval(tick, 1000);
document.getElementById("reset").disabled = true;
document.getElementById("start").disabled = true;
document.getElementById("stop" ).disabled = false;
document.getElementById("timer").disabled = true;
}
function stopTimer() {
clearInterval(timerId);
document.getElementById("reset").disabled = false;
document.getElementById("start").disabled = false;
document.getElementById("stop" ).disabled = true;
document.getElementById("timer").disabled = false;
}
function resetTimer() {
mTime = 0;
document.getElementById("timer").value = mTime;
}
function tick() {
mTime--;
document.getElementById("timer").value = mTime;
if (parseInt(mTime) <= 0) {
stopTimer();
alert("Time over!");
}
}
</script>
</head>
<body>
<table border=0 align="center">
<tr>
<td>
<button onClick="startTimer()" id="start" >Start</button>
<button onClick="stopTimer()" id="stop" disabled=true >Stop</button>
<button onClick="resetTimer()" id="reset" disabled=true >Reset</button>
</td>
</tr>
<tr>
<td>
<input id="timer"></input>
</td>
</tr>
</table>
</body>
</html>
Puzzle (0) | 2016.10.25 |
---|---|
Samll lisp by Javascript (0) | 2016.09.12 |
Chobocho Calc 1 (1) | 2016.04.23 |