• 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:

  • Count the occurrences of a value in an array
  • Count elements in an array
  • Confirm Yes or No With JavaScript
  • Check if all elements in an array are equal

Primary Sidebar

FREE UPDATES!

Get the latest updates in your inbox for FREE!

Popular Posts

Story Generator

IP Grabber

Simple Calendar

Remove Ads

Astrological Calculator

Copyright © 2022 JavaScriptSource.com

  • About
  • Privacy Policy
  • Submit
  • FAQ
  • Jobs For Developers
  • Contact Us