Changing the image source using jQuery

前端 未结 16 2291
天命终不由人
天命终不由人 2020-11-22 01:24

My DOM looks like this:

16条回答
  •  耶瑟儿~
    2020-11-22 02:02

    This is a guaranteed way to get it done in Vanilla (or simply Pure) JavaScript:

    var picurl = 'pictures/apple.png';
    document.getElementById("image_id").src=picurl;
    

提交回复
热议问题