Rewrite the document for Exercise 5.1 to assign the event handler to the event property of the

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 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.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: