By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,964 Members | 1,810 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,964 IT Pros & Developers. It's quick & easy.

How to get the width of a div

P: n/a
I have a div that I need to return the width of. What is the
javascript code?

Jul 10 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
document.getElementById("mydiv").style.width

Jul 10 '06 #2

P: n/a

<je*********@hotmail.comwrote in message
news:11********************@s13g2000cwa.googlegrou ps.com...
>I have a div that I need to return the width of. What is the
javascript code?
var w = document.getElementById("div").offsetWidth;
Jul 10 '06 #3

P: n/a
var w = document.getElementById("div").offsetWidth;

^-- yeah what he said...

(darn google givin me the wrong answer)

Jul 10 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.