How do I get the width in pixels of a HTML <div>
element in javascript?
views:
84answers:
1
+4
A:
try divElement.offsetWidth || divElement.clientWidth
and also you might as well want to try divElement.style.width
Note: divElement is the DOM element of your div which can be obtained by document.getElementById("yourDivId")
Mahesh Velaga
2010-03-30 10:11:28