【发布时间】:2017-03-14 08:03:46
【问题描述】:
我需要改变这个:
<img src="example.jpg" alt="">
进入这个:
<img src="example.jpg?width=500" alt="">
使用 jquery,如何实现,因为我不想覆盖 src, 但只需添加那个 ?width=500 位。
我的代码看起来大致是这样的:
<div class="img-wrap">
<p><a href="link">Link to something</a></p>
<img src="example.jpg" alt="">
</div>
编辑 好的,对不起,我没有指定,但我无法对 img 标签进行任何更改。 图像是从后端生成的。 div,是我唯一可以控制的东西。
【问题讨论】:
-
你的 JS 代码呢?
-
我还没有找到添加它的方法。这是我的问题。