Using JavaScript, write a function that will change the background color of the document to the color the user selects when a button is clicked.
Use an onClick event handler for each button which, when clicked, will call a function to change the background color and pass the necessary color information to the function.
Thinking Aloud - What'll It Take?
Use DOM - Document Object Model: document.bgcolor="colorName"
Give each button a name and id of the chosen color.
Create function called "changeBgColor()".
Place script in body, but above table (so user can't click buttons before script is loaded).
Call the function changeBgColor when user clicks button