Question: Rewrite the document for Exercise 5.1 to assign the event handler to the event property of the button element. This requires the chosen color to

Rewrite the document for Exercise 5.1 to assign the event handler to the event property of the button element. This requires the chosen color to be obtained from the value property of the button element rather than through the parameter.


Data from exercise 5.1

Modify the radio_click.html example to have five buttons, labeled red, blue, green, yellow, and orange. The event handlers for these buttons must produce messages stating the chosen favorite color. The event handler must be implemented as a function whose name must be assigned to the onclick attribute of the radio button elements. The chosen color must be sent to the event handler as a parameter.

Step by Step Solution

3.44 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming World Wide Questions!