alcool9999
07-17-2010, 02:54 PM
Hi, i am simply trying to alert the left position of a css layer.
Javascript:
var Element = document.getElementById('box');
alert(Element.style.left);
CSS
#box {position:absolute;
left:150px;
top:150px;
background-color:blue;
height:100;
width:100;}
HTML
<div id="box">
</div>
The problem is the alert is blank and i can't understand why.
thanks
Javascript:
var Element = document.getElementById('box');
alert(Element.style.left);
CSS
#box {position:absolute;
left:150px;
top:150px;
background-color:blue;
height:100;
width:100;}
HTML
<div id="box">
</div>
The problem is the alert is blank and i can't understand why.
thanks