CS 110 Lab 11 - JavaScript Basics
Objective: learn how to create elementary JavaScript programs.
Using the JavaScript program developed in class as an example, write a
JavaScript program within an HTML page as follows:
- Display a button on the page that reads "Press to run the program".
- When this button is pressed, a confirm dialog box pops up asking the
user "Are you sure?"; this dialog box contains two buttons: "OK" and
"Cancel".
- If the user presses "Cancel" the program does nothing.
- If the user presses "OK" the program will do the following:
- Display a prompt dialog box asking the user to enter their full
name.
- Display a prompt dialog box asking the user to enter what day of the
week is it today.
- Display an alert dialog box displaying a message similar to the
following: "Dear XXX, we are so happy to see you on such a wonderful YYY
as today!", where XXX and YYY are the user's full name and the day of
the week entered previously.
Save your work in an HTML file.
Use Blackboard Vista to submit the HTML file with your work.