My DOM looks like this:
16条回答 南笙 (楼主) 2020-11-22 02:01 You should add id attribute to your image tag, like this: then you can use this code to change the source of images: $(document).ready(function () { $("#img1").attr({ "src": "logo-ex-7.png" }); $("#img2").attr({ "src": "logo-ex-8.png" }); }); 0 讨论(0) 查看其它16个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
You should add id attribute to your image tag, like this:
then you can use this code to change the source of images:
$(document).ready(function () { $("#img1").attr({ "src": "logo-ex-7.png" }); $("#img2").attr({ "src": "logo-ex-8.png" }); });