jQuery .browser Property

Beginner
5 min read
Updated: Nov 2026
3 examples
Utilities

Definition

jQuery.browser (alias $.browser) was a plain object of flags read from navigator.userAgent — browser class booleans plus $.browser.version for the rendering engine (added in jQuery 1.0 / 1.1.3).

Syntax

Start with these common calls. Keep them short and readable.

jQuery
$.browser          → { msie, mozilla, webkit, opera, … }
$.browser.version  → "engine version string"

// Typical legacy flags:
$.browser.msie
$.browser.mozilla
$.browser.webkit   // since 1.4
$.browser.opera
$.browser.safari   // deprecated flag

// Modern jQuery 1.9+ / 3.x:
typeof $.browser   → "undefined"  (unless Migrate)
CallWhat it does
jQueryLearn jQuery.browser: user-agent flags msie mozilla webkit opera, browser.version, deprecated since 1.3 removed in 1.9, Migrate notes, feature detection replacements, examples, and FAQs.

Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.

Parameters

ParameterDescription
Step 1Confirm you are on jQuery ≤ 1.8, or load jQuery Migrate with 1.9+.
Step 2Read a flag such as $.browser.webkit or $.browser.msie.
Step 3Optionally read $.browser.version for the engine version string.

Return Value

Return ValueDescription
BooleanOften true or false depending on the match or state.
jQuery objectMost setters and traversing helpers return the jQuery collection so you can chain more methods.
Value / undefinedGetters usually return a value from the first matched element, or undefined when nothing applies.

jQuery Examples

Example 1 — Official: List $.browser Flags

Dump every key on the browser object (jQuery API sample).

jQuery
// Requires jQuery ≤ 1.8 or 1.12 + browser present
jQuery.each(jQuery.browser, function (i, val) {
  console.log(i + " : " + val);
});
Try It Yourself

How It Works

  1. Object. jQuery.browser holds the parsed flags.
  2. Each. jQuery.each walks every key/value pair.
  3. Print. Log name : value for msie/mozilla/webkit/opera/version.

Example 2 — Official: msie and version

Check Internet Explorer and read the engine version string.

jQuery
console.log($.browser.msie);     // true only on old IE UA
console.log($.browser.version);  // engine version string

if ($.browser.msie) {
  console.log("IE engine: " + $.browser.version);
}
Try It Yourself

How It Works

  1. Flag. $.browser.msie is true only when the UA looks like IE.
  2. Version. $.browser.version is always a string when $.browser exists.
  3. Branch. Old plugins often gated IE-only fixes behind this flag.

Example 3 — Official: WebKit Conditional

Alert-style branch for WebKit browsers (Chrome/Safari family UA).

jQuery
if ($.browser.webkit) {
  console.log("This is WebKit!");
} else {
  console.log("Not WebKit");
}
Try It Yourself

How It Works

  1. Flag since 1.4. webkit replaced older Safari-centric sniffing.
  2. Branch. True when the UA reports a WebKit engine family.
  3. Message. Print a short status for debugging legacy code.

Frequently Asked Questions

jQuery.browser was a plain object of Boolean flags parsed from navigator.userAgent — msie, mozilla, webkit, opera, and the deprecated safari flag. jQuery.browser.version held the rendering engine version string. Added in jQuery 1.0.
No in stock jQuery 1.9+. It was deprecated in 1.3 and removed in 1.9. jQuery 3.x does not include $.browser unless you load the jQuery Migrate plugin, which restores it for legacy code.
User-agent sniffing is unreliable — strings can be spoofed, compatibility modes lie, and new browsers break if/else chains. jQuery recommends feature detection instead of browser names.
A string reporting the rendering engine version from the user agent (for example Gecko for Firefox). It was removed with $.browser in 1.9 and has the same spoofing problems as the flags.
$.browser guessed the browser from the user-agent string. $.support ran feature tests for DOM/CSS quirks. Prefer feature detection for new code; treat both as legacy APIs when reading old tutorials.
Detect capabilities: CSS.supports() for CSS, "fetch" in window for APIs, and progressive enhancement. Use jQuery Migrate only while rewriting old plugins that still sniff $.browser.

Next: jQuery.boxModel Property

See the removed box-model flag and the modern replacements.

jQuery.boxModel Property tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful