what is the alternative to offsetLeft in internet-explorer (not work with me in ie)
<p>My question is obvious, doesn't need to Clarify.</p>

<p>My code</p>

<pre><code>document.onkeypress = function(evt) {
                var elem = document.getElementById('box');
                evt = evt || window.event;
                var charCode = evt.charCode || evt.keyCode;
                switch (charCode) {
                    case 37:
                        elem.style.position = 'absolute';
                        elem.style.left = parseInt(elem.offsetLeft - 10) + 'px';
                        elem.innerHTML = elem.offsetLeft;
                        break;
                    case 38:
                        elem.style.position = 'absolute';
                        elem.style.top = parseInt(elem.offsetTop - 10) + 'px';
                        elem.innerHTML = elem.offsetTop;
                        break;
                    case 39:
                        elem.style.position = 'absolute';
                        elem.style.left = parseInt(elem.offsetLeft + 10) + 'px';
                        elem.innerHTML = elem.offsetLeft;
                        break;

                    case 40:
                        elem.style.position = 'absolute';
                        elem.style.top = parseInt(elem.offsetTop + 10) + 'px';
                        elem.innerHTML = elem.offsetTop;
                        break;
                    case 101:
                        elem.style.position = 'relative';
                        elem.style.left = 0 + 'px';
                        elem.style.top = 0 + 'px';
                        break;

                    default:

                }
            };
</code></pre>

<p>The previous example work fine in ff but not work in ie.</p>

<p>What is the reason of <code>offsetLeft</code> and <code>offsetTop</code>  don't work in IE.<br>
Is there an alternative to internet-explorer or so, what's the problem ?</p>

<hr>

<h2>Try the <a href="http://jsfiddle.net/ZbDnT/" rel="nofollow">Demo</a> In jsfiddle.</h2>
