因为没有代码,我们只能猜测你的dom关系,试下
<img src="你的图片地址" onclick="alert(this.parentNode.parentNode.rowIndex)">