var element = document.getElementById('image1');
function leftArrowPressed () {
element.style.left = parseInt(element.style.left) - 5 + 'px';
}
The code is for moving images with arrow keys. When element
is a global variable it doesn't work but works when it's a local variable. Why?