forked from Likelion-Inha-11/FE_JavaScript_Application
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem3.html
More file actions
29 lines (26 loc) · 922 Bytes
/
Copy pathProblem3.html
File metadata and controls
29 lines (26 loc) · 922 Bytes
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
<!--3번 문제. -->
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8" />
<title>로그인 구현하기</title>
<script>
let userName = prompt("사용자 이름을 입력해주세요.", "");
if (userName === "LikeLion") {
let pass = prompt("비밀번호:", "");
if (pass === "KingJs") {
alert("환영합니다!");
} else if (pass === null || pass === "") {
alert("취소되었습니다.");
} else {
alert("인증에 실패하였습니다."); //틀린 비밀번호를 입력한다면
}
} else if (userName === null || userName === "") { //ESC를 누르거나 빈문자열을 입력한다면
alert("취소되었습니다.");
} else {
alert("인증되지 않은 사용자입니다."); //틀린 사용자 이름을 입력한다면
}
</script>
</head>
<body></body>
</html>