jQuery Getting and setting outerWidth and outerHeight (including padding and border)


Example

Get width and height (excluding margin):

var width = $('#target-element').outerWidth();
var height = $('#target-element').outerHeight();

Get width and height (including margin):

var width = $('#target-element').outerWidth(true);
var height = $('#target-element').outerHeight(true);

Set width and height:

$('#target-element').outerWidth(50);
$('#target-element').outerHeight(100);