To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.
See it run: Changing Menus Dynamically
This HTML file sets up a menu with the months of the year; the following JavaScript will populate a second menu with the number of days in the month after the user chooses a month.
When the user picks a month from the first pop-up menu, this JavaScript populates a second pop-up menu with the correct number of days for the selected month.