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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

size and location of DIV

Status
Not open for further replies.

wac

Programmer
Sep 6, 2002
7
US
How do I get the location (x and y, or top and left) and size (width and height) of a DIV element using javascript?
 
If it was set, you can do this:

...
var the_top=document.getElementById("div_name").style.top;
var the_left=document.getElementById("div_name").style.left;
var the_width=document.getElementById("div_name").style.width;
var the_height=document.getElementById("div_name").style.height;
...

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top