var el = document.getElementById("yourElement"); // or other selector like querySelector() var rect = el.getBoundingClientRect(); // get the bounding rectangle console.log( rect.width ); console.log( rect.height);