-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathExercise10.html
26 lines (23 loc) · 1.1 KB
/
Exercise10.html
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
<!DOCTYPE html>
<html>
<head>
<p> Hello </p>
</head>
<body>
<script>
alert("This website is extremely awesome and should be enjoyed with caution");
alert("Hello " + prompt("What is your name?") + "! Thank you for visiting this website");
console.log(prompt("What is your favorite sports team?") + " is a dumb sports team.");
</script>
</body>
</html>
<!-- Exercise 10
Introducing the JavaScript console:
Open the JavaScript console using [cmd + opt + j]
Use the console as a simple caluculator. Use all of the following operators in various combinations: +, -, *, /, %.
Understand PEDMAS, use parentheses to change the answers to some of your previous equations.
From the console, calculate how many seconds old you are and alert that number.
Create a simple web page. Inside of a script tag, alert visitors that your site is extremely awesome and should thus be enjoyed with caution.
When a visitor visits your page, ask what their name is using prompt. Alert a greeting using their name.
After greeting them, ask them what their favorite sports team is. Secretly log a message trash-talking that team in the console.
-->