How do I calculate the difference between two strings in Javascript?
<p>Everything was  fine until when I wanted to calculate the difference between the two values and I got 0 as a result.</p>

<p>I'm really new to this, I'm sure it's really easy to do it and that I have to turn it from string to variable or something like that but I don't know how to do it.</p>

<pre><code>oldx = parseInt(document.getElementById("character").style.left);
oldy = parseInt(document.getElementById("character").style.top);

newx = evt.pageX;
newy = evt.pageY;

disx=parseInt(oldx) - parseInt(newx);
disy=parseInt(oldy) - parseInt(newy);

document.getElementById('disx').innerHTML=disx;
document.getElementById('disy').innerHTML=disy;
</code></pre>

<p>I'm testing it here: <a href="http://chusmix.com/game/movechar.php" rel="nofollow">http://chusmix.com/game/movechar.php</a> You can see everything works except the end where i Get 0, 0.</p>

<p>How could I make it work?
Thanks</p>
