• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
JavaScriptSource

JavaScriptSource

Search 5,000+ Free JavaScript Snippets

  • Home
  • Browse Snippets
    • Addon
    • Ajax
    • Buttons
    • Cookies
    • CSS
    • Featured
    • Forms
    • Games
    • Generators
    • Image Effects
    • Math Related
    • Miscellaneous
    • Multimedia
    • Navigation
    • Page Details
    • Passwords
    • Text Effects
    • Time & Date
    • User Details
Home / Miscellaneous / Detect Internet Explorer browser

Detect Internet Explorer browser

Detect Internet Explorer browser

Check if the current browser is Internet Explorer (IE):

const isIe = function() {
    const ua = window.navigator.userAgent;
    return ua.indexOf('MSIE') > -1 || ua.indexOf('Trident') > -1;
};

We also can rely on document.documentMode. This property indicates the document compatibility mode of the document which is an integer in IE 5-11. Other browsers return undefined.

const isIE = !!document.documentMode;

Source

https://htmldom.dev/detect-internet-explorer-browser/

Miscellaneous

Related Snippets:

  • Insert an element into the DOM after another one
  • Create an element
  • Finding a specific object in an array of objects
  • Copy a segment of an array into a new array

Primary Sidebar

Popular Posts

Story Generator

IP Grabber – get a users IP address with JavaScript

Simple Calendar

Remove Ads

Astrological Calculator

Copyright © 2025 JavaScriptSource.com

  • About
  • Privacy Policy
  • FAQ
  • Jobs For Developers