-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathday-2a.html
More file actions
48 lines (42 loc) · 1.21 KB
/
day-2a.html
File metadata and controls
48 lines (42 loc) · 1.21 KB
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
<!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>Day 2 Part A</title>
</head>
<body>
<h1>Input from user</h1>
<h2>Example</h2>
<p>Here we have a message using the data that the user input into the prompt.</p>
<p>
<script>
let userName;
userName = prompt("What is your name?");
document.write(`Hi ${userName}, nice to meet you!`);
</script>
</p>
<section>
<h2> You Try It!</h2>
<p>Write a message using the dog's name.</p>
<p>
<script>
let dogName;
dogName = prompt("What is the name of your dog?");
// Try it! Write a message about the dog's name!
document.write();
</script>
</p>
</section>
<h2>You Try it!</h2>
<p>Now write a message using both the dog's name and the user's name from above. Note: You don't have to ask the user
again. The variables have already been assinged in the above section. </p>
<p>
<script>
// Try it! Write a message using both variables: userName and dogsName, from above.
document.write();
</script>
</p>
</body>
</html>