0 javascript jquery attributes attr
如何获取div类中的href链接 .image1
<div class="image1">
    <a href="/images/productA.jpg"> </a>
</div>
并将其添加到src此处的图片中...
<ul class="example">
    <li class="GalleryImage1"> <img src="" > </li>
</ul>
小智 5
您可以尝试以下方法:
var href = $('.image1 a').attr('href');
//if you want the href to all img in the ul
$('.example li img').attr('src',href);
//if you want the href only to this li
$('.example .GalleryImage1 img').attr('src',href);