Modify this in-class
example so that, in addition to setting the background colors of
the page and the table, the font color on the page is set to yellow
when the button is clicked. Add a line in the function
changePage to do this.
Note that, just like
style.backgroundColor refers to the
background color of a page,
style.color refers to the
This problem is similar to problem 1, but now instead of the fixed color (yellow) the person can enter the new color text color.
Modify the in-class
example with the form to allow the person to enter a new font
color for the page: add a new text input in the form (call it
textcolor) and use it in the
page must have a form to enter names of two candidates and their
corresponding votes. When the button is clicked, display the winner
and the number of votes in the text area.
Below is the starting point for the problem. save it to a file and add the missing elements. Note that since the form gives you strings, not numbers, you need to use
parseFloat as shown below to use the form data as
Send me (and CC to yourself) all the work that you finish during the lab time. If you have not finished everything during the lab, please include the final version with the next problem set.
The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.