-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
62 lines (44 loc) · 1.47 KB
/
app.js
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
function name() {
var message = '';
var userName = prompt('What is you name?');
var age = prompt('How old are you?');
alert('Hello ' + userName);
if (age < 18) {
message = ', Stay eating healthy and have complemetary vitamins.';
} else {
message = ', Do not stop doing sports and stay fit.';
}
return document.write('<h1>' + userName + message + '</h1>');
}
/*
var knowMore = confirm("Do you want to know more?");
var readMore = "";
if (knowMore == true) {
document.write(`<a href="https://www.ucsfhealth.org/education/tips-for-staying-healthy">' + readMore + </a>`);
} else {
}
*/
function read() {
var userEnter = prompt('What do you want to read about? sports or food.');
while (userEnter !== 'sports' && userEnter !== 'food') {
userEnter = prompt('Please Enter sports or food.');
}
if (userEnter === 'sports') {
document.write('<a href="https://thuraya12.github.io/staying-healthy/index.html" >' + userEnter + '</a>');
} else {
document.write('<a href="https://raghad-qassim.github.io/staying-healthy/" >' + userEnter + '</a>');
}
}
name();
read();
/*
var pic = '';
var picture = '<img src="images/2.png"/>';
var numTimes = prompt('How many reminders you want to be notified with?');
for (var i = 0; i < numTimes; i++) {
pic = pic + picture;
}
*/
// document.write(pic);
// document.write('<h1>' + userName + message + '</h1>');
// document.write('<h2>' + 'Stay Safe' + '</h2>');