JQUERY 提取多个元素 a img 的 src href

<div class="abc">
<a href="1.html"><img src="1.jpg"/>111</a>
<a href="2.html"><img src="2.jpg"/>222</a>
<a href="3.html"><img src="3.jpg"/>333</a></div>

我需要提取abc中的 a标签的href属性,也就是1.html 还有img标签 src属性 也就是1.jpg

function aaaa(){$(".abc img").each(function(i){urlsrc = this.src;
目前提取img的写法 

写成以下:
function aaaa(){$(".abc img a").each(function(i){
srcurl= this.src;
hrefurl= this.href;
不生效,,如何能取到两个呢??

1
2
3
4
$(".abc a").each(function(){
    srcurl= $(this).attr('href');
    hrefurl= $(this).find('img').attr('src');
})
原文地址:https://www.cnblogs.com/xzzzys/p/7767788.html