-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring_ob3.html
More file actions
35 lines (30 loc) · 816 Bytes
/
string_ob3.html
File metadata and controls
35 lines (30 loc) · 816 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
30
31
32
33
34
35
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
var userEmail = prompt("당신의 이메일 주소는?","");
var arrUrl = [".co.kr",".com",".net",".or.kr",".go.kr"];
var check1 = false;
var check2 = false;
if(userEmail.indexOf("@")>0){
check1 = true;
}
for(var i=0; i<arrUrl.length; i++){
if(userEmail.indexOf(arrUrl[i])>0){
check2 = true;
}
}
if(check1 && check2){
document.write(userEmail);
}
else{
alert("이메일 형식이 잘못되었습니다.");
}
</script>
</body>
</html>