Joda Maki Joda Maki - 4 months ago 13
Javascript Question

How to find the width of a div using raw Javascript?

How do you find the current width of a div in a cross browser compatible way without using a library like JQuery?

Answer
document.getElementById("mydiv").offsetWidth

Or, to include border size in the width:

document.getElementById('mydiv').clientWidth