JavaScript In-Class Examples

---Answer Key---

In these examples, we will go through the instructions on this page.

Each time we see a comment, we will modify the contents between the "script" tags below it so that the code does what the comment requests.

Question 1

What is 12 * 6 ?

Question 2

Question 3

Question 4

With formatting:

4 > 5 =

6 > 5 =

Question 5

Pop up window text: "Welcome to my JavaScript test!"

Question 6

Pop up window text: "What is your name?" / "Hello [name], nice to meet you!"

Question 7

This is a paragraph about time.

Question 8