23.7. Exercises: The DOM and EventsΒΆ

Time to make a flight simulator for your fellow astronauts! The provided HTML and JavaScript files can be used for all of the exercises. For each exercise, the requirements and desired effect of the events is listed.

Repl.it with starter code

  1. When the "Take off" button is clicked, the text "The shuttle is on the ground" changes to "Houston, we have lift off!". The "Take off" button has an id of "liftoff".
  2. When the user's mouse goes over the "Abort Mission" button, the button's background turns red. The "Abort Mission" button has an id of "abortMission".
  3. When the user clicks the "Abort Mission" button, make a confirmation window that says "Are you sure you want to abort the mission?".