Lab 1

Implement each button's functionality (use getElementById):

  • "Enter Name" -> User should enter his/her name.
  • "Enter Age" -> User should enter his/her age.
  • "Display Message" -> Hello my name is __, I'm __ years old. It is nice to meet you!

Lab 2

Write a script to display random images every time you click the browser's refresh button. The following is an image of the mpl2.html file see image.

When you complete the lab, you must see the following: see image.

Lab 3

Create a web page that displays (either an alert box or add html tags to use getElementById) the cost of a movie ticket for a customer. The user should be prompted for the age of the customer. The output should be a message telling the user what the customer's ticket will cost, based on the following criteria:

  • Under age 5 the entry is free
  • Between ages 5 and 12 (inclusive) a child's ticket costs $5.00
  • Older than 12 an adult ticket costs $9.00

You have to implement each button by using an if and switch statement.

Lab 4

Create a web page that allows the user to reverse a string. For Example, if the user types Mirror Image, after the button is clicked, the text will say egamI rorriM. You have to implement each button by using a while, do while and for loop.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.