Welcome to the Treehouse Community
Looking to learn something new?
Sam WeeksFront End Web Development Techdegree Student 16,699 Points
placeimg doesnt reload a fresh img each time stays on same img am i doing something wrong?
<img src="https://placeimg.com/400/400/any" alt="Drawing of Jane Smith" class="profile-image">
Steven Parker216,083 Points
Your browser may be displaying a cached image instead of fetching a new one.
document.querySelector("img").src += "?nocache=" + Math.random();
Note that this particular script only targets the first image on the page.
Fantastic! Adding this code inside a pair of <script> tags in the <body> element fixed the issue. Thanks so much!