you have to iterate through your images and make comparisons to find out<script language="javascript">
function tellwhich()
{
var images = document.all("xx");
if (images)
{
if (images.length)
{
for (var i=0; i < images.length; i++)
{
if (images[i] == window.event.srcElement)
{
alert("you are no. " + (i + 1));
break;
}
}
}
else
alert("you are the only one");
}
else
alert("you do not exist, or you do not have the right id");
}</script>
<img src="zip.gif" id="xx" ondblclick="tellwhich();">
<img src="zip.gif" id="xx" ondblclick="tellwhich();">
<img src="zip.gif" id="xx" ondblclick="tellwhich();">
function tellwhich()
{
var images = document.all("xx");
if (images)
{
if (images.length)
{
for (var i=0; i < images.length; i++)
{
if (images[i] == window.event.srcElement)
{
alert("you are no. " + (i + 1));
break;
}
}
}
else
alert("you are the only one");
}
else
alert("you do not exist, or you do not have the right id");
}</script>
<img src="zip.gif" id="xx" ondblclick="tellwhich();">
<img src="zip.gif" id="xx" ondblclick="tellwhich();">
<img src="zip.gif" id="xx" ondblclick="tellwhich();">
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货