문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
|
wiki:javascript:javascript_note:js_timing [2021/04/12 16:40] emblim98 만듦 |
wiki:javascript:javascript_note:js_timing [2023/01/13 18:44] (현재) |
||
|---|---|---|---|
| 줄 166: | 줄 166: | ||
| =====More Examples===== | =====More Examples===== | ||
| - | ====Another | + | ====Another |
| <code javascript> | <code javascript> | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | <button onclick=" | ||
| + | <p id=" | ||
| + | < | ||
| + | function timedText() { | ||
| + | setTimeout(myTimeout1, | ||
| + | setTimeout(myTimeout2, | ||
| + | setTimeout(myTimeout3, | ||
| + | } | ||
| + | function myTimeout1() { | ||
| + | document.getElementById(' | ||
| + | } | ||
| + | function myTimeout2() { | ||
| + | document.getElementById(' | ||
| + | } | ||
| + | function myTimeout3() { | ||
| + | document.getElementById(' | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||
| - | < | + | =====A clock created with a timing event===== |
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | < | ||
| + | function startTime() { | ||
| + | var today = new Date(); | ||
| + | var h = today.getHours(); | ||
| + | var m = today.getMinutes(); | ||
| + | var s = today.getSeconds(); | ||
| + | m = checkTime(m); | ||
| + | s = checkTime(s); | ||
| + | document.getElementById(' | ||
| + | var t = setTimeout(startTime, | ||
| + | } | ||
| + | function checkTime(i) { | ||
| + | if (i < 10) { i = " | ||
| + | return i; | ||
| + | } | ||
| + | </ | ||
| + | </ | ||
| + | <body onload=" | ||
| + | <div id=" | ||
| + | </ | ||
| + | </ | ||
| + | </ | ||