I have this small code:
<img id="icon" src="https://www.w3schools.com/tags/smiley.gif" alt="Smiley face" height="42" width="42">
$(window).bind("load", function () {
document.getElementsByClassName("icon").src = "http://via.placeholder.com/42x42";
console.log(document.getElementsByClassName("icon").src);
});
I am using this logic in my project "Show the Local Weather Incomplete " but I can update the image, any idea… according to the log, the src is Ok, but not rendered in the HTML…
The goal is put the proper icon or image after get the wheater conditions…
Full project: https://codepen.io/aasanchez/pen/ZxYWJg