The task consisted of two parts; setting a random background color and setting a specified background color. However I decided to merge the two parts together into a single program with all behaviors spread out over three buttons and a text field. Seen below are the demands supplied by the institution.
- Usage of
push()to get and set values of an array of colors.
css()function to set an elements background color.
ready()handler to determine if the entire document has been loaded.
- Load jQuery in minified format from Googles CDN.
Following these criteria, I created listeners for each button press, that either set the color to the last specified or used a randomized selection of color from the array either once or with one second intervals.