How to check for all versions of IE (including IE 11)

Just found out this lovely tidbit today that IE 11 has decided to drop MSIE from its user-agent. That means that if you need to detect any version of IE, you’ll need to use a different regular expression.

This is what I came up with for my use case. The MSIE part captures <= 10 and the Trident part should capture 11+. navigator.userAgent.match(/(MSIE|Trident\/.*rv:[0-9]*)/i)

Leave a Reply

Your email address will not be published. Required fields are marked *