portfolio/src/main/webapp/script.js
/**
 * Generates a URL for a random image in the images directory and adds an img
 * element with that URL to the page.
 */
Generates a URL for a random image in the images directory and adds an img
element with that URL to the page.
Generates a URL for a random image in the images directory and adds an img element with that URL to the page .
function randomizeImage() {
  const imageIndex = Math.floor(Math.random() * 12) + 1;
  const imgUrl = 'images/photo-with-google/' + imageIndex + '.jpeg';
  const imgElement = document.createElement('img');
  imgElement.src = imgUrl;
  const imageContainer = document.getElementById('random-image-container');
  imageContainer.innerHTML = '';
  imageContainer.appendChild(imgElement);
}
function randomizeImage ( ) { const imageIndex = Math . floor ( Math . random ( ) * 12 ) + 1 ; const imgUrl = 'images/photo-with-google/' + imageIndex + '.jpeg' ; const imgElement = document . createElement ( 'img' ) ; imgElement . src = imgUrl ; const imageContainer = document . getElementById ( 'random-image-container' ) ; imageContainer . innerHTML = '' ; imageContainer . appendChild ( imgElement ) ; }
Generates a URL for a random image in the images directory and adds an img
 element with that URL to the page.
Generates a URL for a random image in the images directory and adds an img element with that URL to the page .
// Remove the previous image.