作者:宝宝717917 | 来源:互联网 | 2023-02-02 11:54
if I have the following html:
如果我有以下html:
how can i get my alert function to work so it alerts the img src that is the actual image getting pinned, which has a class="lazy"
always in it.
如何让我的警报函数正常工作,以便它向img src发出警报,这是被固定的实际图像,其中始终有一个class="lazy"。
$('div.pinIt').click(function() {
var url = $(this).closest('img.lazy').attr('src');
alert(url);
});
all it alerts for me is undefined
. what am i doing wrong?
它对我的所有警告都是未定义的。我做错了什么?
2 个解决方案