Passing Image ID to USEMAP OnClick Function

I am using usemap for a set of images

<map name="movemap">
    <area shape="rect"  coords="0,0,200,200" a href="" onclick="jumps(); return false;">
</map>

      

I have a set of images that use a map. For example.

<img id=1 usemap=#movemap src=abc.gif />
<img id=2 usemap=#movemap src=def.gif />
<img id=3 usemap=#movemap src=xyz.gif />

      

Now in the function, jumps()

I need to know which image was clicked. So, in the jumps()

onclick function , how can I get the id

image that was clicked by the user.

+3


source to share





All Articles