standard way to get the width of an element

L

laredotornado

Hello,
I am looking for a cross browser way (IE, Firefox, Safari) of
getting the screen width, in pixels, of an element on my page. I am
interested in the "navImg" table cell. Here is a snippet of code:

<tr>

<td style="width:45px; height:38px;" id="navImg" name="navImg"><img
src="images/NAV_07.gif" alt="" border="0"></td>

How would I use JS to get this width? (I can't just use 45 as a
hard-coded value, because I may be going in and changing this table
cell).

Thanks, - Dave
 
R

RobG

Hello,
I am looking for a cross browser way (IE, Firefox, Safari) of
getting the screen width, in pixels, of an element on my page. I am
interested in the "navImg" table cell. Here is a snippet of code:

<tr>

<td style="width:45px; height:38px;" id="navImg" name="navImg"><img
src="images/NAV_07.gif" alt="" border="0"></td>

How would I use JS to get this width? (I can't just use 45 as a
hard-coded value, because I may be going in and changing this table
cell).

Thanks, - Dave

In regard to cross-browser-nes, usefull stuff is located here:

<URL:http://www.quirksmode.org/viewport/compatibility.html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top