+ 6
How could i make it at a random position ? HELP Please !
I want the red circle ⭕ to be at a random position at the web page . How could I do that? This is the code 👇👇 https://code.sololearn.com/WHU6BpX6HBg0/?ref=app
1 Resposta
+ 2
Add this to your JS.
window.onload = function(){
var c = document.getElementById("c");
c.style.marginTop = Math.random() * window.innerHeight + "px";
c.style.marginLeft = Math.random() * window.innerWidth + "px";
};