我想使用javascript从网站中提取图片网址,但我想要在鼠标所在的图像上提取图像的网址。我想要完整的网址
答案 0 :(得分:0)
使用jQuery:
$(document).on("mouseover", "img", function(event){
console.log($(this).attr("src"));
});
这会绑定该网站上所有img元素的所有鼠标悬停事件,并重新启动其源属性
以下是有关jQuery on()如何工作的更多信息:http://api.jquery.com/on/