[Solved] write code within a div instead of body with documentwrite


try

$("div").append('<img class="leaves'+i+'" src="'+rndLeaf+'" style="background-color:none;position:absolute;top:'+Ypos[i]+'px;left:'+Xpos[i]+'px;height:'+height[i]+'px;width:'+width[i]+'px;opacity:'+opacityLeaf[i]+';">');

solved write code within a div instead of body with documentwrite