function drawPixel(width, height, color, container){ var pixel = document.createElement("DIV"); pixel.style.fontSize = "1px"; pixel.style.width = width + "px"; pixel.style.height = height + "px"; pixel.style.backgroundColor = color; container.appendChild(pixel); } drawPixel("10", "10", "#098890", document.getElementsByTagName('body')[0]);