This Pen is owned by w3resource on CodePen . running in. To learn more, see our tips on writing great answers. Why is 51.8 inclination standard for Soyuz? Please be aware that we are not responsible for the privacy practices of such other sites. image variable, all that is left is to Willmaster A community dedicated to all things web development: both front-end and back-end. The image Let's look at the implementation of all this next. document.write(FirstPart + r + LastPart); For example, you can use the following code found at https://stackoverflow.com/questions/2777479/display-random-image-when-page-loads-without-utilizing-onload-in-the-body-tag: Each time you reload that Google search will display many articles containing javascript code to display random image.