Programmatically change the src of an img tag

后端 未结 9 1837
执念已碎
执念已碎 2020-11-22 04:31

How can I change the src attribute of an img tag using javascript?


         


        
9条回答
  •  轮回少年
    2020-11-22 05:34

    Give your img tag an id, then you can

    document.getElementById("imageid").src="../template/save.png";
    

提交回复
热议问题