I think you might need to use offsetLeft instead.
<div id="myDiv" style="height: 50; width: 50; position:absolute; left:
350; top: 50;background-color: red;"> </div>
<script>
var output = '<table>';
obj = document.getElementById('myDiv');
for (var prop in obj) {
output += '<tr><td>' + prop + '</td><td>:<td>' + obj[prop] +
'</td></tr>';
}
output += '</table>';
document.write(output);
</script>
Spike
> -----Original Message-----
> From: Justin MacCarthy [mailto:[EMAIL PROTECTED]]
> Sent: 20 September 2002 17:47
> To: [EMAIL PROTECTED]
> Subject: [ cf-dev ] quick JS / DOM / getElementById
>
>
> Quick question.
>
> What is the DOM (ie+, ns7+ mozilla) method of getting the
> position of a div?
>
> If I have a <div id="mybutton"><img src="..."></div>
>
> How do I get the position of the div?
>
> document.getElementById("mybutton").left is blank..
>
> Thanks
>
> Justin
>
>
> --
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED] For human help, e-mail:
> [EMAIL PROTECTED]
>
>
--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]