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
javascript jquery events image


source to share


No one has answered this question yet

Check out similar questions:

6493
var functionName = function () {} vs function functionName () {}
2644
Is there a function "exists" for jQuery?
2256
Set default parameter value for JavaScript function
2237
How do I pass command line arguments to a Node.js program?
1832
Lazy loading images in ListView
1449
Previewing an image before uploading it
1338
How to vertically align an image inside a div
923
jQuery multiple events to trigger the same function
0
Firefox does not register an onclick event handler
0
USEMAP and ONCLICK used in IMG Tag not working in Firefox



All Articles
Loading...
X
Show
Funny
Dev
Pics