vaniella js return width of element code example Example: javascript get width of a div document.getElementById("mydiv").offsetWidth