How to store DOM style property in variable
<p>I have this code here:</p>

<pre><code>function slideUp(elem,num,speed,lim){
    var pos = document.getElementById(elem).style.top
    var moveUp = num
    if(lim != pos){
        var int = setInterval(function(){
            moveUp = moveUp-100;
            document.getElementById(elem).style.top=+moveUp+"px";
        },speed)
    }else if(lim == pos){
        clearInterval(int);
    }   
}
</code></pre>

<p>The problem that i am having is the "pos" variable does not hold a value. I want it to hold the top position of an element that i specify   </p>
