Date: 2014mar17
Language: javaScript
Library: jQuery
Q. jQuery: get the *rendered* size (width and height) of an element?
A. With jQuery use .width() and .height() like this:
function exampleUse() {
const boxWidth = $('#mybox').width();
const boxHeight = $('#mybox').height();
console.log("box width x height is " + boxWidth + " x " + boxHeight);
}
There is also:
const boxWidth = $('#mybox').css('width');
const boxHeight = $('#mybox').css('height');
Which gives a number followed by "px" - eg "100px"
Generally, less useful.