how to get div last width in javascript code example Example: javascript get width of a div document.getElementById("mydiv").offsetWidth