我有这样的结构:在我的情况下,ta如何调用函数?
<a href="some.jpg"><img src="other.jpg" onclick="someAction(this);"></a>
<a href="some2.jpg"><img src="other2.jpg" onclick="someAction(this);"></a>
<a href="some3.jpg"><img src="other3.jpg" onclick="someAction(this);"></a>
当我尝试添加警示(this)来的onclick,我得到[对象HTMLImageElement]
我需要从其他部分调用此someAction的精确图像页
如何做到这一点?
这是因为'this'是HTML Image元素......你想从它得到什么? – tymeJV
看起来一切正常! (实际上,你并没有真正解释'alert(this)'是什么,也不是你想做什么)。 –
someAction将大图像加载到div中,而不是改变小图像的CSS。我想用