Home» Forum» Web & Tech» ISO HTML: update an image on a specific calendar date?

ISO HTML: update an image on a specific calendar date?

Back to Web & Tech

Not for FR, but for my own website.


What I am asking for/about is like, on December first, a picture of me switches out with a picture of me with a poorly drawn santa hat.


Is there a code that I can set up to have it pull from a small selection of images automatically on a specified date? I feel like I have seen it before, but now I can't find it....

~°☆Get in loser, we're living past the end our myth☆°~

I don't see a link to your site anywhere. Can you provide it, please?

@Bill Liam East https://cornergardenplot.neocities.org/

I don't have an attempt at the code anywhere, I'm just wondering if such a command exists.

~°☆Get in loser, we're living past the end our myth☆°~

@Erah Mar

It does, and its a pretty short if/then in js, but I wanted to try to be direct with it so there's no confusion.

@Erah Mar

It was giving me hell for some reason, but I got it.

Use img  id="1" src=""

Then put this at the very end before /body and inside of script /script

Change the image path to what you want it.

The 8 is September, so 0 is Jan and 11 is Dec


document.addEventListener("DOMContentLoaded", () =>{

const t = new Date();

const m = t.getMonth();

const d = t.getDate();

const i = document.getElementById("1");

if (i){

if (m === 8 && d === 5){

i.src = "https://eastathenaeum.net/ResearchDevelopment/Icon.png";}

else{i.src = "https://cornergardenplot.neocities.org/images/sanctum.png";}

}});

@Erah Mar

Also there's a head to close before body and h5 to close before /footer. Fortunately, browser seems to correct it fine, but I think it was throwing the code off on my end somehow.

You must be logged in to reply.