I'm fairly new to HTML and I'm able to successfully generate the random numbers, but I want to attach an image to a specific number E.G a card game (11 =jack =12=queen ..etc)
This is what I have
function numbers() {
var x = Math.floor((Math.random() * 10) + 1);
var img = document.createElement("img");
if(x ==1||2||3||4||5||6||7) {
img.src = "ace.jpg";
}
document.getElementById("num").innerHTML = "Rule " + x;
}
Aucun commentaire:
Enregistrer un commentaire