Mini-Lab: This is Your Lucky Day!


Introduction

You have probably seen coin-operated scales that offer to tell you your weight and lucky number for 25 cents. Most people would not pay 25 cents to weigh themselves, but who can pass up a chance to learn their lucky number? In this lab, you will create a web page that will provide visitors with a lucky number and a lucky letter, similar to the following:

Welcome to this lucky page!
Your lucky number is 23.
Your lucky letter is Q.

You will be using many of the same techniques as in the Mad Libs and Calculator mini-labs, and you can look at them if you want to remember how to create a button, define a function, or add output to an HTML element. You can also copy, paste, and modify code snippets if you wish.

If your code isn't working as expected, try opening up Firefox's error console to check for (potentially) helpful error messages. If you get stuck, don't hesitate to ask the instructor or a teaching assistant for help.


Exercises:

Lucky Number:


Lucky Letter:


Lucky Word (if you have time):


Polish & Publish your program: