Javascript
var brandscolors = [
{
brand: 'ABC',
color1: '#0099e5',
color2: '#ff4c4c',
color3: '#34bf49'
},
{
brand: 'Akamai',
color1: '#0099cc',
color2: '#ff9933',
},
{
brand: 'Alibaba',
color1: '#ff6a00',
}
];
brandscolors.forEach(function(element) {
var div = document.createElement("div");
div.style.width = "100px";
div.style.height = "100px";
div.style.background = element.color1;
div.style.color = "black";
div.innerHTML = element.brand;
document.getElementById("main").appendChild(div);
});
Kolay gelsin.