View Full Version : getting coordinates of an element with respect to top left of page

09-23-2005, 11:54 PM
How would you go about getting the (x,y) coordinates of an HTML element (a DIV in my case) with respect to the top left of the viewing area (basically, under the back button). I need this to work in firefox and don't care about IE. I've tried element.top and element.left, along with element.style.top and element.style.left, but neither seems to work. Any ideas?

09-24-2005, 03:00 AM
Try here (http://www.oreillynet.com/pub/a/javascript/excerpt/JSDHTMLCkbk_chap13/index6.html)