// A function for setting the horizontal position of an element function setX(elem, pos) { // Set the ‘left’ CSS property, using pixel units elem.style.left = pos + “px”; } // A function for setting the vertical position of an element function setY(elem, pos) { // Set the ‘left’ CSS property, using pixel units elem.style.top = pos + “px”; }