I created the following JS in an external file:
var n = Math.floor((Math.random() * 1000) + 1); { window.alert(n);
if (n) var output = ""; if (n % 3 == 0) output += "Rock"; if (n % 5 == 0) output += "star"; window.alert(output || n); }
I want to implement this code when a person clicks a button on the webpage.
Would I use need to place this into my html page: Click me?
Aucun commentaire:
Enregistrer un commentaire