Computer Science Homework Help

GCCCD Write a Code to Toggle the Background Color of Your Page Programming Task

 

write a code to toggle the background color of your page between white and black when clicking on a button. The text on your button also needs to toggle between ‘Night Mode’ and ‘Day Mode’. Please watch the video below to see what you should achieve when completing this assignment:

Create a basic HTML document with correct structural elements such as <head>, <title>, <body>, etc.

Name your HTML document ‘LastName_FirstName.html

  • Create a button on your page using HTML. Add a heading and a paragraph explaining what your button is doing something similar to what is shown in the example above.
  • Use javascript and CSS to let users toggle between Day and Night mode by clicking on your button.

Use embedded CSS and JavaScript to keep all your codes in one document (use <style> and <script> tags within your HTML document) – it would be easier to submit just one file that includes everything for this assignment.