Core 5 | Professor Dexter

JavaScript : Lesson 3 : Exercise 4

Counting Clicks

In this exercise, you'll just modify the webpage given in Figure 13.7 of the book. First, here is the full page (the book only provides the JavaScript part).

Modify this page as follows.  Give the form 3 different "CLICK ME" buttons, and 3 text fields, which will give the number of clicks for each button.  Remove the "GET TOTAL #" button; instead, each time a button is clicked, the appropriate text field should be immediately updated.

Some hints:  you 'll need three "count" variables and three functions (one for each button).  These functions should combine the actions of the add_one() and get_total() functions.
 


[ Previous | Index | Next ]