Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML element positions using DOM

Status
Not open for further replies.

Codfish

Programmer
Apr 29, 2001
11
US
Using the client side DOM I can get the position of an element using:

var myelement = document.getElementById("myid")
alert(myelement.style.top)

but if a style attribute such as style="top:100" for the HTML element has not been defined the style properties are empty in the DOM. Is there a way to get the coordinates of the element other than the style properties?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top