-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuestion28.html
More file actions
35 lines (30 loc) · 903 Bytes
/
Question28.html
File metadata and controls
35 lines (30 loc) · 903 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 http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Question 28</title>
</head>
<body>
<h1 id="string"></h1>
<script>
var age = prompt('Enter person age:');
let text = '';
if (age < 2){
text = "Person is baby";
}else if (age >= 2 && age < 4){
text = "Person is a toddler";
}else if(age >= 4 && age < 13){
text = "Person is kid";
}else if (age >= 13 && age < 20){
text = "Person is a teenager";
}else if(age >= 20 && age < 65){
text = "Person is an adult";
}else{
text = "Person is an elder";
}
document.getElementById('string').innerHTML = text;
</script>
</body>
</html>