User Tools

Site Tools


eg-259:homework:10

JavaScript and HTML Documents: Part 1

Adapted from: Robert W. Sebasta, Programming the World-Wide Web, 3rd Edition, Addison Wesley, 2006. Supporting: Contact Hour 11.

  1. Modify the radio_click.html example from the lecture to have five radio buttons, labelled “red”, “blue”, “green”, “yellow”, and “orange”. The event handlers for these buttons must produce messages stating the chosen favourite colour. The event handler must be a function, whose name must be assigned to the onclick attribute of the button elements. The chosen colour must be sent to the event handler as a parameter.
  2. Rewrite the document for Exercise 1 to assign the event handler to the event property of the button element. This requires the chosen colour to be obtained from the value property of the button element rather than through the parameter.

More Homework Exercises

eg-259/homework/10.txt · Last modified: 2012/02/17 12:27 by eechris