Created
April 21, 2018 02:55
-
-
Save jonathandavidpollock/725fbe870aecd371a74bf67e89f75322 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = () => { | |
console.log('Inside the JS function'); | |
// find the image elements | |
let imgArray = document.querySelectorAll('.style_size'); | |
// Randomly pick a number | |
// Locate the image based off Random Number | |
const num = Math.floor(Math.random()*imgArray.length); | |
const imageToDisplay = imgArray[num]; | |
imageToDisplay.style.display = "block"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment