can somebody explain to me why this is so?
the alert returns object in square brackets. why doesn't it return id1? Obviously the alert doesn't provide any functionality to what I'm trying to do. What I was trying to say was:
Code:
var foo = document.getElementById("id1");
alert(foo);
Code:
var foo = document.getElementById("id1");
if(foo.style.top < 120)
{
foo.style.top += 20;
}
but when it wasn't working, I put in the alert to see why. So can somebody answer why the alert doesn't return id1?
Thanks everybody!!