Alternating Image / Text
If you visit http://cia.geoworld.org/France, you'll see a map of France near the top of the page. Beneath the map is the following text:
"2007 Click to see a map from the 2001 Factbook"
I'd like to modify my page so that when a visitor clicks on the image, a different map appears. If they click on the 2007 map, it's replaced by the 2001 map and vice versa. At the same time, the text changes to match. For example, if the 2001 map is displayed, the following text would appear under it:
"2001 Click to see a map from the 2007 Factbook"
How can I do something like this?
You'll need to write an event handler for a click on the map. You can then write a function, which will be triggered by the click, that will replace/swap the text and map using the DOM - each element will have its own id making it available to document.getElementById(). Here's a link that may help you get started:
Thanks, I'll check it out.