Random number generator in JavaScript 🎲【4 minutes】

Published: 21 April 2022
on channel: Bro Code
80,198
2.2k

#Javascript #random #number #generator

let x;
let y;
let z;

document.getElementById("rollButton").onclick = function(){

x = Math.floor(Math.random() * 6) + 1;
y = Math.floor(Math.random() * 6) + 1;
z = Math.floor(Math.random() * 6) + 1;

document.getElementById("xlabel").innerHTML = x;
document.getElementById("ylabel").innerHTML = y;
document.getElementById("zlabel").innerHTML = z;
}


Watch video Random number generator in JavaScript 🎲【4 minutes】 online without registration, duration hours minute second in high quality. This video was added by user Bro Code 21 April 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 80,19 once and liked it 2.2 thousand people.