Easy Tutorial
❮ Jq Sel Target Event Blur ❯

jQuery outerWidth() Method

jQuery HTML/CSS Methods

Example

Return the outer width of a <div> element:

$("button").click(function(){
    alert($("div").outerWidth());
});

Definition and Usage

The outerWidth() method returns

As shown in the image below, this method includes padding and border.

Tip: To include margin, use outerWidth(true).


Related Methods:


Syntax

Parameter Description
includeMargin Optional. Boolean value, specifies whether to include margin. false - Default. Does not include margin.<br>true - Includes margin.

More Examples

Include Margin

Display Dimensions Using Related Methods


jQuery HTML/CSS Methods

❮ Jq Sel Target Event Blur ❯