如何改变div标签中的属性?

32 浏览
0 Comments

如何改变div标签中的属性?

这个问题在这里已经有了答案:
使用jQuery更改图像源

当我想要替换img属性时,我遇到了问题。在 class="HotProject_item HotProject_item_preview isotope-item" 内容中的class ="content-asset"有

我想用新图像更改img src。你能帮我吗?

Title ABC

Decription 🙂   Subtitle

admin 更改状态以发布 2023年5月24日
0
0 Comments

为此需要做如下操作:

$(".content-asset img").attr("src","newimg.jpg");

即将其源属性更改为指向newimg.jpg。

0