Re: Is it possible to use onClick with an Image in Mozilla?



Actually it seems it does work if I remove the usemap feature.

<a href="javascript:void(0)" onClick="alert('hi');"><IMG src="foo.gif"
border="0"></a>

The problem is I need to use the imagemap to determine where they
click, but because the imagemap is reused multiple times, I don't have
the context of which image the user actually clicked.

<a href="javascript:void(0)" onClick="alert('hi');"><IMG src="foo1.gif"
name="foo1" usemap="#someImageMap" border="0"></a>

<a href="javascript:void(0)" onClick="alert('hi');"><IMG src="foo2.gif"
name="foo2" usemap="#someImageMap" border="0"></a>

Is there any way to capture this context in the map itself where I can
retrieve the name?
<map name="someImageMap">
<area shape="rect" coords="0,0,15,16" onClick="inputValue(1,this)"
ALT="Section 1">
<area shape="rect" coords="16,0,33,16" onClick="inputValue(2,this)"
ALT="Section 2">
</map>

.