일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- jQuery 백스페이스
- ajax 배열 파라미터
- 여러줄 한줄로
- i_tail
- 뒤로가기 방지
- 화면보호기 실행 방지
- 허드슨 포트 변경
- javascript Camel
- eclipse properties
- css 말줄임
- 트리거 이벤트
- 스킵 네비게이션
- ajax 배열
- 팝업 종료
- taglib 만들기
- DIV 팝업 이외 영역 클릭 시 팝업 닫기
- JSP Standard Tag Library (JSTL) Tutorial
- Spring Annotation
- javascript 낙타
- eclipse 폰트
- 시퀀스 초기화 프로시져
- 엑셀 UPDATE
- #오라클 데이터 복구
- 폴더만 남기고 파일만 삭제
- 전화번호 형식 자동 변환
- jquery_cheat_sheet #jquery_quick_api_reference
- 탭과 클릭 focus 이벤트 구분
- eclipse 다국어
- jquery_api #jquery #api
- 근무날짜 경력계산
Archives
- Today
- Total
Hi~ Summers!!
setInterval을 이용한 타이머(timer) 본문
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <!doctype html> <html lang="ko"> <head> <title> New Document </title> <meta charset="utf-8"> <script> var timer; var maxMin = "30"; window.onload = function() { txt_timer.value = maxMin; timer = setInterval(handleTimer, 1000); // 3초 간격으로 호출 } function handleTimer() { txt_timer.value = txt_timer.value*1 - 1; if(txt_timer.value == 0) { if(confirm("타이머 종료?")) { clearInterval(timer); // 타이머 종료 } else { txt_timer.value = maxMin; } } } </script> </head> <body> <input type="text" id="txt_timer" /> </body> </html> |
Comments