-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestion30.html
More file actions
27 lines (23 loc) · 853 Bytes
/
Question30.html
File metadata and controls
27 lines (23 loc) · 853 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Question 30</title>
</head>
<body>
<h1 id="string"></h1>
<script>
var username = prompt("Please enter your username:");
var users = ['admin', 'bill', 'mark', 'tom', 'jenny', 'elon'];
for(var i = 0; i < users.length; i++){
if (username == "admin"){
document.getElementById('string').innerHTML = "Hello admin, would you like to see a status report?";
}else if(users.includes(username)){
document.getElementById('string').innerHTML = `Hello ${username}, thank you for logging in again.`;
}
}
</script>
</body>
</html>