I have the following code and it seems like the .style does not recognize my variable wid! what is wrong with it?
var wid = document.getElementById("bd").offsetWidth/2;
obj = document.getElementById('div1');
obj.style.left = wid.toString();
'bd' is the id of my body and 'div1' the id of the div i want to move. If I just use the following, it works fine:
obj.style.left = '10px';