jQuery.boxModel (alias $.boxModel) was a Boolean that reported whether the browser was using the W3C CSS box model (true, standards mode) or the older quirks-mode box model (false). It was added in jQuery 1.0, deprecated in 1.3 and removed in 1.8, so in jQuery 3.x it is undefined.
Syntax
Start with these common calls. Keep them short and readable.
Legacy flag: true for the W3C box model, false in quirks mode.
typeof $.boxModel
"undefined" in jQuery 1.8+ — guard before reading it.
document.compatMode
"CSS1Compat" (standards) or "BackCompat" (quirks).
getComputedStyle(el).boxSizing
Per-element content-box or border-box sizing.
Read $.boxModel only with a guard such as typeof $.boxModel !== "undefined". On jQuery 3.7.1 the property does not exist.
Parameters
Step
Description
Step 1
Confirm your jQuery version — the property exists only before 1.8.
Step 2
Guard the read: typeof $.boxModel !== "undefined".
Step 3
Prefer document.compatMode and CSS box-sizing in new code.
Return Value
Return Value
Description
Boolean (legacy)
true when the page used the W3C box model; false in quirks mode.
undefined (modern)
jQuery 1.8+ and 3.x do not define the property, so reading it gives undefined.
jQuery Examples
Example 1 — Official Demo (with a Guard)
The old API sample printed the box model into the page. Add a guard so it also runs on modern jQuery.
jQuery
// jQuery <= 1.7 returned true or false; modern jQuery has no such property.
var model = typeof $.boxModel === "undefined"
? "(not available)"
: String($.boxModel);
$("#msg").html("The box model for this page is: <span>" + model + "</span>");
console.log($("#msg").text());
Read.getComputedStyle(el).boxSizing returns the box model for that element.
Measure. With content-box, padding and border add to the 100px width.
Switch.border-box keeps the outer width at 100px.
Frequently Asked Questions
jQuery.boxModel was a Boolean property that told you whether the browser rendered the page with the W3C CSS box model (true) or the quirks-mode box model (false). It was added in jQuery 1.0 to help with old Internet Explorer layout differences.
No. It was deprecated in jQuery 1.3 and removed in 1.8. In jQuery 3.x, $.boxModel is undefined, so reading it does not give you a Boolean.
jQuery 1.3 pointed to jQuery.support.boxModel as the replacement, but that flag is gone from modern jQuery too. Use native checks instead: document.compatMode for the page mode and getComputedStyle(el).boxSizing for individual elements.
A valid doctype such as <!DOCTYPE html> puts the browser in standards mode (document.compatMode is "CSS1Compat"). A missing or old doctype triggers quirks mode ("BackCompat"), which mimics legacy rendering, including the old box model.
Always include <!DOCTYPE html> and set box-sizing explicitly, for example * { box-sizing: border-box; }. Then width and height include padding and border everywhere, and you rarely need to detect the box model.
jQuery handles the difference for you. .width() returns the content width, and .outerWidth() adds padding and border, regardless of box-sizing, so you can measure without checking any box-model flag.