You want to create 10
<div>
s with random positions and colours.
But you declare the positions and colours
outside of your loop. The values don't change within the loop, so you create all 10 elements at the same position, and with the same colour.
Move the position and colour calculations inside the loop.
var ww = $(window).width();
var wh = $(window).height();
var div = "<div />";
for (var i = 0; i <= 10; i++){
var r = parseInt(Math.random()*256);
var g = parseInt(Math.random()*256);
var b = parseInt(Math.random()*256);
var color = `rgb(${r},${g},${b})`;
var posx = (Math.random() * ww);
var posy = (Math.random() * wh);
$(div).css({"background": color, "width":"50", "height":"50","position":"absolute", "top": posy, "left": posx}).appendTo("body");
}