87,922
社区成员
发帖
与我相关
我的任务
分享
function testFunction(objElement){
alert("标签名:" + objElement.tagName + " 图片路径:" + objElement.src)
}
//修改
//<img src="../images/zoom.gif" width="14" height="14" border="0" onclick="testFunction(this);">
function testFunction(){
if(this!=null && this.tagName!=null){
alert("标签名:" + this.tagName + " 图片路径:" + this.src)
}
}
//修改
//<img src="../images/zoom.gif" width="14" height="14" border="0" onclick="testFunction">
<img src="../images/zoom.gif" width="14" height="14" border="0" onclick="alert('aa')">
<script language="JavaScript">
for(i=0;i<document.getElementsByTagName("img").length;i++)
{
if(document.getElementsByTagName("img")[i].src="../images/zoom.gif")
{
document.getElementsByTagName("img")[i].onclick();
}
}
</script>