CpSc 217 - Structured and Dynamic Web Programmings
Start a new web page
- Put some text on the page. Make sure it includes your name.
- Place two buttons on the page: Next and Automate
- Place one text box on the page labeled seconds
- In the head section, create a new array in javascript of size 12 called
colors
- Select 12 different colors and set the elements of the array to these
- Write a function named pick that randomly generates a number from 0 to 11
- Write a function named nextone that calls pick, then changes the
background color of the page to the color associated with the array element
returned by pick.
- Add an onclick to the Next button to call nextone
- Test and debug your code
- Part 0
- Write a recursive function called automate that changes the background
color every second.
- Add an onclick to the Automate button that calls this function
- Part 1
- Use the value of the text box labeled microseconds so that the
user can select the time between background color changes
- Part 2
- Write a function to clear the Timeout
- Part 3
Modify the code to progressively go through Hex values.