How to get new background image after each reload/refresh?

I need to create a webpage with a background image, and I need the background image to change after each refresh or reload of the page. Can anyone help me with this?
Also, the images have been uploaded in any online bucket, meaning they are links and not stored on my device, so cannot use the random() method.
I am trying to do this using JavaScript OR JQuery. So, answers in these languages would be preferred.