Hi, I'm doing a little experiment trying to randomly place images inside a div using a javascript loop. I've been having some trouble with it.
Here's what I have (simplified):
for(var i = 0; i < 10; i++)
{
var top = random(-20, 20);
var left = random(-20, 20);
document.write(
<div class="one" style="\"left:" + left + ";\"">
<img src="hein.png"/>
</div>
);
}
The goal being to generate some top and left values, and every itteration display a new image with these generated values. I know it's a syntax error with the style="". But nothing I've tried has worked
How can I get this working.