Detect Internet Explorer browser

Look for document.documentMode, which only Internet Explorer defines.

JavaScriptBrowser · DOM Version 1.0.0 · MIT · .md

detect-internet-explorer-browser.js
function isInternetExplorer() { return 'documentMode' in document; }

Usage

usage.js
isInternetExplorer(); // → false

Lines marked → were executed in headless Chromium against the markup above, and each result was compared with the value shown. Lines marked e.g. are illustrative.

Know the limits

  • Microsoft retired the Internet Explorer 11 desktop application in June 2022. Keep this only to show an upgrade notice in legacy intranets.
  • Detect the feature you need instead of the browser, such as "IntersectionObserver" in window.

The function above is the code the usage lines run. It does not validate its arguments; add checks where it receives untrusted input.

Source & maintenance

Based on Detect Internet Explorer browser from the original 1loc collection by Nguyen Huu Phuoc. Copyright (c) 2020 phuoc-ng. MIT licensed.

Documented as a reference with executed usage lines. Original MDX retained as inert source evidence.

Maintained by Oveyon. Source commit: 14b481cf60df. Read the license.

Usage lines executed in headless Chromium against the fixture markup; no external services · reviewed October 28, 2026.

Keep exploring

Type two or more characters. Try “duplicate”, “webhook” or “retry”.