javascriptbuttoninteractiveclickableareas

How do I create clickable areas on an image within a webpage with javascript?


I want to create a webpage displaying an image that has areas on it that can be clicked to do various things like playing sound, displaying text, linking to other pages. The only problem is I have no idea what I need to use within javascript to do so. The area need not be complicated, just a simple geometric shape.

What sort of tools should I be looking at in Javascript to do achieve this?

Thanks in advance


Solution

  • You might want to take a look at <map></map> tag in HTML: http://www.w3schools.com/tags/tag_map.asp It should accomplish what you want to do.