var element = document.getElementById("square"); element.style.background = "blue"; element.innerHTML = "Test"; element.style.left = (parseInt(element.style.left) || 0) + 20 + "px";