Connecting Javascript with HTML



Cat fighter

In this battle simulator I have worked with randomizing image arrays and attaching name ids to the specific images within the array. Math.floor was essential for keeping the images developing within the array numbers. randomNum was the variable used as the randomizer. myFn was used to link the javascript to the html elements.

Your Fighters


hero 1
hero 2
hero 3

Your Opponents


cat
cat
kjhasdf






Did you win?