<head>
<style>
body div {
height: 100px;
width: 250px;
background-color: #c1c1c1;
margin: 5px;
float: left;
}
</style>
</head>
<body>
</body>
<script>
function createDivs() {
var u = ['/img/1.jpg', '/img/2.jpg', '/img/3.jpg'], tmp = document.createDocumentFragment();
for (var i = 0; i<u.length; i++) {
var div = document.createElement('div');
div.style.backgroundImage = 'url(' + u[i] + ')' ;
div.innerHTML = 'Мой background-image = ' + u[i];
tmp.appendChild(div);
}
document.getElementsByTagName('body')[0].appendChild(tmp);
}
createDivs();
</script>