I'm creating a website with HTML, CSS, and JavaScript. I have a picture element on my page, among other elements.
What I want to achieve is to randomnly change the picture every hour. I am able to do this perfectly fine by running it in my browser.
My question is: how does one randomly change an element across the board (the entire internet) for all users?
The way I have it written, it only runs the random pic function within my browser, and resets every time I refresh the page.
I'm currently using setInterval()
and checking the time constantly to see if the current date.getMinutes() === 0
, then I figure it's a new hour, and i call a changePicHourly()
function.
I have no problem getting this to work. However, obviously every visitor to my page will see a different picture. I do not want that. I want consistency across time and space! Haha.
I'm not asking for specific coding instructions, I'm more focused on trying to understand the concept. How does one change elements internet-wide?
Hopefully I am making this clear. Thank you!!