웹팁 분류
나이를 구해주는 계산 스크립트
작성자 정보
- GW 작성
- 작성일
컨텐츠 정보
- 1,442 조회
- 목록
본문
미리보기는 하단에...^^
생년월일을 입력하면 나이를 구해주는 스크립트
html
<input type="text" id="testUserYear" placeholder="태어난 연도를 입력하세요">
<button type="button" id="testAgeBtn">SUBMIT</button>
<p id="testResultBox">당신의 나이는: <span></span></p>
script
document.querySelector('#testAgeBtn').addEventListener('click', function() {
var birthYear = document.querySelector('#testUserYear').value;
if(! birthYear) {
alert('태어난 연도를 입력하세요');
document.querySelector('#testUserYear').focus();
} else {
var today = new Date();
var nowYear = today.getFullYear();
var age = nowYear - birthYear + 1;
document.querySelector('#testResultBox span').innerText = age;
}
});
↑↑ 위 코드 ↑↑
↓↓ 사용미리보기 ↓↓
아재감성 아재공간 다온네
-나이계산,생년월일,스크립트,자바스크립트 출생년도를 입력하면 나이를 알 수 있습니다. 1996생 몇살 1963 몇살 2002년생 몇살-
-
등록일 05.10
-
등록일 04.08
-
등록일 03.08
-
등록일 03.15
-
등록일 03.18
-
등록일 03.19
-
등록일 04.11
-
등록일 04.23
-
등록일 04.05
-
등록일 03.13
-
등록일 03.08
-
등록일 02.23
-
등록일 03.19
-
등록일 05.07
-
등록일 03.15
-
등록일 03.13
-
등록일 03.18
-
등록일 02.25
-
등록일 04.19
-
등록일 05.16
-
등록일 03.08
-
등록일 04.13
-
등록일 05.17
-
등록일 03.15
-
등록일 04.05
-
등록일 03.15
-
등록일 04.04
-
등록일 03.08
-
등록일 02.26
-
등록일 05.09
추천 업체
아재 음악
스팅 - 잉글리쉬맨 인 뉴욕 1987년
Opus - Live Is Life (Remix 2016) 유로댄스 레전드 라이브 이즈 라이프Opus - Live Is Life 1984년All…
오타완 핸즈업 Ottawan - Hands Up 1981
Yazoo - Don't Go (1982년)Came in from the city walked into the doorI turned aroun…
관련자료
댓글 0
등록된 댓글이 없습니다.