May 07, 2021 jQuery
With jQuery, it's easy to work with elements and browser window sizes.
jQuery offers several important ways to handle dimensions:
The width() method sets or returns the width of the element (excluding margins, borders, or margins).
The height() method sets or returns the height of the element (excluding margins, borders, or margins).
The following example returns the width and height of the specified element:
The innerWidth() method returns the width of the element, including the inner margin.
The innerHeight() method returns the height of the element, including the inner margin.
The following example returns the inner-width/height of the specified element:
The outerWidth() method returns the width of the element, including the inner margin and border.
The outerHeight() method returns the height of the element, including the inner margin and border.
The following example returns the outer-width/height of the specified element:
Tip: The outerWidth (true) method returns the width of the element(including margins, borders, and margins);